🎨 Remove title attribute when converting the document to a heading (#15019)

This commit is contained in:
Jeffrey Chen 2025-06-12 21:45:42 +08:00 committed by GitHub
parent 5ac69bfe36
commit 9668d29a35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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