🎨 Remove the collapsed state of the collapsed heading on paste https://github.com/siyuan-note/siyuan/issues/13232

This commit is contained in:
Daniel 2024-12-11 21:53:25 +08:00
parent 922f9fe075
commit 50793ad855
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -547,6 +547,22 @@ func GetHeadingChildrenDOM(id string) (ret string) {
nodes := append([]*ast.Node{}, heading)
children := treenode.HeadingChildren(heading)
nodes = append(nodes, children...)
// 取消折叠 https://github.com/siyuan-note/siyuan/issues/13232#issuecomment-2535955152
for _, child := range children {
ast.Walk(child, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering {
return ast.WalkContinue
}
n.RemoveIALAttr("heading-fold")
n.RemoveIALAttr("fold")
return ast.WalkContinue
})
}
heading.RemoveIALAttr("fold")
heading.RemoveIALAttr("heading-fold")
luteEngine := util.NewLute()
ret = renderBlockDOMByNodes(nodes, luteEngine)
return