Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-09-18 12:58:27 +08:00
commit 6375f96823
2 changed files with 3 additions and 3 deletions

View file

@ -2102,7 +2102,7 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
if addTitle {
if root, _ := getBlock(id, tree); nil != root {
root.IAL["type"] = "doc"
title := &ast.Node{ID: root.ID, Type: ast.NodeHeading, HeadingLevel: 1}
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1}
for k, v := range root.IAL {
if "type" == k {
continue

View file

@ -221,7 +221,7 @@ func Outline(rootID string, preview bool) (ret []*Path, err error) {
if preview && Conf.Export.AddTitle {
if root, _ := getBlock(tree.ID, tree); nil != root {
root.IAL["type"] = "doc"
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1}
title := &ast.Node{ID: root.ID, Type: ast.NodeHeading, HeadingLevel: 1}
for k, v := range root.IAL {
if "type" == k {
continue
@ -231,7 +231,7 @@ func Outline(rootID string, preview bool) (ret []*Path, err error) {
title.InsertAfter(&ast.Node{Type: ast.NodeKramdownBlockIAL, Tokens: parse.IAL2Tokens(title.KramdownIAL)})
content := html.UnescapeString(root.Content)
title.AppendChild(&ast.Node{ID: root.ID, Type: ast.NodeText, Tokens: []byte(content)})
title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})
tree.Root.PrependChild(title)
}
}