From eb823ce35a66c1e04275ff0c00d632d45d86d06e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 5 Aug 2022 22:37:16 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=A0=87=E9=A2=98=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=90=8E=E7=BC=96=E8=BE=91=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E8=A7=A6=E5=8F=91=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20Fix=20https://github.com/siyuan-note/siyuan/issues/5576?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/heading.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/model/heading.go b/kernel/model/heading.go index 8cdc3376c..b538cb76f 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 }