Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Liang Dingeb823ce35a66
diff --git a/kernel/model/heading.go b/kernel/model/heading.go
index 8cdc3376c8..b538cb76f0 100644
--- a/kernel/model/heading.go
+++ b/kernel/model/heading.go
@@ -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
}