🎨 API /api/block/* 支持插入或更新带有块级 IAL 的空段落块 Fix https://github.com/siyuan-note/siyuan/issues/6713

This commit is contained in:
Liang Ding 2022-11-25 18:04:55 +08:00
parent aafbd204db
commit c0d1451c7b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 10 additions and 29 deletions

View file

@ -469,7 +469,7 @@ func genTreeID(tree *parse.Tree) {
return ast.WalkContinue
}
if treenode.IsEmptyBlockIAL(n) {
if n.IsEmptyBlockIAL() {
// 空段落保留
p := &ast.Node{Type: ast.NodeParagraph}
p.KramdownIAL = parse.Tokens2IAL(n.Tokens)

View file

@ -924,7 +924,7 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (err error) {
}
luteEngine := NewLute()
dom := luteEngine.Md2BlockDOM(md)
dom := luteEngine.Md2BlockDOM(md, false)
err = createDoc(box.ID, p, title, dom)
if nil != err {
return
@ -943,7 +943,7 @@ func CreateWithMarkdown(boxID, hPath, md string) (id string, err error) {
WaitForWritingFiles()
luteEngine := NewLute()
dom := luteEngine.Md2BlockDOM(md)
dom := luteEngine.Md2BlockDOM(md, false)
id, _, err = createDocsByHPath(box.ID, hPath, dom)
return
}