From 8da31e7b1c7ad8a5810af77e9d20dced8f8d4f9e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 9 Dec 2022 20:22:08 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=AF=BC=E5=85=A5=E7=A9=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9=20Markdown=20=E6=96=87=E4=BB=B6=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20Fix=20https://github.com/siyuan-note/siyuan/issues/?= =?UTF-8?q?6832?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/box.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/model/box.go b/kernel/model/box.go index f6ef21498..1020549a3 100644 --- a/kernel/model/box.go +++ b/kernel/model/box.go @@ -464,6 +464,10 @@ func parseKTree(kramdown []byte) (ret *parse.Tree) { } func genTreeID(tree *parse.Tree) { + if nil == tree.Root.FirstChild { + tree.Root.AppendChild(parse.NewParagraph()) + } + ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus { if !entering { return ast.WalkContinue