mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-30 04:05:16 +01:00
♻️ 将解析渲染器 Protyle 项目合并到 Lute 项目中 https://github.com/siyuan-note/siyuan/issues/5602
This commit is contained in:
parent
929b27b7f6
commit
dc193ce904
13 changed files with 55 additions and 46 deletions
|
|
@ -22,7 +22,7 @@ import (
|
|||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/protyle"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -294,7 +294,7 @@ func dataBlockDOM(data string, luteEngine *lute.Lute) (ret string) {
|
|||
ret = luteEngine.Md2BlockDOM(data)
|
||||
if "" == ret {
|
||||
// 使用 API 插入空字符串出现错误 https://github.com/siyuan-note/siyuan/issues/3931
|
||||
blankParagraph := protyle.NewParagraph()
|
||||
blankParagraph := parse.NewParagraph()
|
||||
ret = lute.RenderNodeBlockDOM(blankParagraph, luteEngine.ParseOptions, luteEngine.RenderOptions)
|
||||
}
|
||||
return
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import (
|
|||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/88250/lute/render"
|
||||
"github.com/88250/protyle"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
|
|
@ -70,7 +69,7 @@ func html2BlockDOM(c *gin.Context) {
|
|||
}
|
||||
|
||||
if ast.NodeListItem == n.Type && nil == n.FirstChild {
|
||||
newNode := protyle.NewParagraph()
|
||||
newNode := parse.NewParagraph()
|
||||
n.AppendChild(newNode)
|
||||
n.SetIALAttr("updated", util.TimeFromID(newNode.ID))
|
||||
return ast.WalkSkipChildren
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue