Skip to content

Commit 5af4674

Browse files
committed
🎨 Improve exporting #14782
1 parent cbf5834 commit 5af4674

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/model/export.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,6 +2322,13 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
23222322
if root, _ := getBlock(id, tree); nil != root {
23232323
root.IAL["type"] = "doc"
23242324
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1}
2325+
for k, v := range root.IAL {
2326+
if "type" == k {
2327+
continue
2328+
}
2329+
title.SetIALAttr(k, v)
2330+
}
2331+
title.InsertAfter(&ast.Node{Type: ast.NodeKramdownBlockIAL, Tokens: parse.IAL2Tokens(title.KramdownIAL)})
23252332
content := html.UnescapeString(root.Content)
23262333
title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})
23272334
ret.Root.PrependChild(title)

0 commit comments

Comments
 (0)