Skip to content

Commit

Permalink
🎨 Remove the collapsed state of the collapsed heading on paste #13232
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Dec 11, 2024
1 parent 922f9fe commit 50793ad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kernel/model/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 50793ad

Please sign in to comment.