🐛 导入空内容 Markdown 文件时报错 Fix https://github.com/siyuan-note/siyuan/issues/6832

This commit is contained in:
Liang Ding
2022-12-09 20:22:08 +08:00
parent 81e5bdc32a
commit 8da31e7b1c

View File

@@ -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