Skip to content

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

:art: Remove `title` attribute when converting the document to a heading (#15019)

Jeffrey Chen9668d29a350a
diff --git a/kernel/model/heading.go b/kernel/model/heading.go
index 9269a1da05..529195ad1d 100644
--- a/kernel/model/heading.go
+++ b/kernel/model/heading.go
@@ -199,6 +199,7 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
heading := &ast.Node{ID: srcTree.Root.ID, Type: ast.NodeHeading, HeadingLevel: headingLevel, KramdownIAL: srcTree.Root.KramdownIAL}
heading.SetIALAttr("updated", util.CurrentTimeSecondsStr())
heading.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(srcTree.Root.IALAttr("title"))})
+ heading.RemoveIALAttr("title")
heading.Box, heading.Path = targetTree.Box, targetTree.Path
if "" != tagIAL && 0 < len(tags) {
// 带标签的文档块转换为标题块时将标签移动到标题块下方 https://github.com/siyuan-note/siyuan/issues/6550