Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve exporting https://github.com/siyuan-note/siyuan/issues/14782

Daniel5af4674f05c1
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 829df231e9..c71f9216c4 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -2322,6 +2322,13 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
if root, _ := getBlock(id, tree); nil != root {
root.IAL["type"] = "doc"
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)
title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})
ret.Root.PrependChild(title)