Bläddra i källkod

:art: Improve dailynote template rendering https://github.com/siyuan-note/siyuan/issues/13111

Daniel 8 månader sedan
förälder
incheckning
e69ea30a4e
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      kernel/model/box.go

+ 2 - 0
kernel/model/box.go

@@ -497,6 +497,8 @@ func parseKTree(kramdown []byte) (ret *parse.Tree) {
 func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
 func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
 	if nil == tree.Root.FirstChild {
 	if nil == tree.Root.FirstChild {
 		tree.Root.AppendChild(treenode.NewParagraph(""))
 		tree.Root.AppendChild(treenode.NewParagraph(""))
+	} else if !tree.Root.FirstChild.IsBlock() || ast.NodeKramdownBlockIAL == tree.Root.FirstChild.Type {
+		tree.Root.PrependChild(treenode.NewParagraph(""))
 	}
 	}
 
 
 	var unlinks []*ast.Node
 	var unlinks []*ast.Node