mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Improve exporting https://github.com/siyuan-note/siyuan/issues/14782
This commit is contained in:
parent
cbf5834e6d
commit
5af4674f05
1 changed files with 7 additions and 0 deletions
|
|
@ -2322,6 +2322,13 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
||||||
if root, _ := getBlock(id, tree); nil != root {
|
if root, _ := getBlock(id, tree); nil != root {
|
||||||
root.IAL["type"] = "doc"
|
root.IAL["type"] = "doc"
|
||||||
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1}
|
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1}
|
||||||
|
for k, v := range root.IAL {
|
||||||
|
if "type" == k {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
title.SetIALAttr(k, v)
|
||||||
|
}
|
||||||
|
title.InsertAfter(&ast.Node{Type: ast.NodeKramdownBlockIAL, Tokens: parse.IAL2Tokens(title.KramdownIAL)})
|
||||||
content := html.UnescapeString(root.Content)
|
content := html.UnescapeString(root.Content)
|
||||||
title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})
|
title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})
|
||||||
ret.Root.PrependChild(title)
|
ret.Root.PrependChild(title)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue