🎨 Improve doc tree parsing

This commit is contained in:
Daniel 2024-03-16 12:22:18 +08:00
parent dab89c39fa
commit ff79d71286
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 7 additions and 1 deletions

View file

@ -2114,6 +2114,7 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
if addTitle {
if root, _ := getBlock(id, tree); nil != root {
root.IAL["type"] = "doc"
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1, KramdownIAL: parse.Map2IAL(root.IAL)}
content := html.UnescapeString(root.Content)
title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})