This commit is contained in:
Daniel 2024-11-11 18:01:22 +08:00
parent 76141021d0
commit e69ea30a4e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -497,6 +497,8 @@ func parseKTree(kramdown []byte) (ret *parse.Tree) {
func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
if nil == tree.Root.FirstChild {
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