mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🎨 Improve doc tree parsing
This commit is contained in:
parent
dab89c39fa
commit
ff79d71286
5 changed files with 7 additions and 1 deletions
|
|
@ -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)})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue