🐛 标题转换文档后编辑原文档触发状态异常 Fix https://github.com/siyuan-note/siyuan/issues/5576

This commit is contained in:
Liang Ding 2022-08-05 22:37:16 +08:00
parent fbfad46818
commit eb823ce35a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -26,6 +26,7 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/88250/protyle"
"github.com/siyuan-note/siyuan/kernel/cache"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/treenode"
@ -297,6 +298,9 @@ func Heading2Doc(srcHeadingID, targetBoxID, targetPath string) (srcRootBlockID,
headingNode.Unlink()
srcTree.Root.SetIALAttr("updated", util.CurrentTimeSecondsStr())
if nil == srcTree.Root.FirstChild {
srcTree.Root.AppendChild(protyle.NewParagraph())
}
if err = indexWriteJSONQueue(srcTree); nil != err {
return "", "", err
}