mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
🎨 Remove the collapsed state of the collapsed heading on paste https://github.com/siyuan-note/siyuan/issues/13232
This commit is contained in:
parent
922f9fe075
commit
50793ad855
1 changed files with 16 additions and 0 deletions
|
|
@ -547,6 +547,22 @@ func GetHeadingChildrenDOM(id string) (ret string) {
|
||||||
nodes := append([]*ast.Node{}, heading)
|
nodes := append([]*ast.Node{}, heading)
|
||||||
children := treenode.HeadingChildren(heading)
|
children := treenode.HeadingChildren(heading)
|
||||||
nodes = append(nodes, children...)
|
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()
|
luteEngine := util.NewLute()
|
||||||
ret = renderBlockDOMByNodes(nodes, luteEngine)
|
ret = renderBlockDOMByNodes(nodes, luteEngine)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue