mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +01:00
🎨 Improve fold heading editing https://github.com/siyuan-note/siyuan/issues/14349 Point 01
This commit is contained in:
parent
9e7426a6f4
commit
de55ea9315
2 changed files with 26 additions and 0 deletions
|
|
@ -85,6 +85,20 @@ func GetHeadingFold(nodes []*ast.Node) (ret []*ast.Node) {
|
|||
return
|
||||
}
|
||||
|
||||
func IsUnderFoldedHeading(node *ast.Node) bool {
|
||||
for n := node.Previous; nil != n; n = n.Previous {
|
||||
if ast.NodeHeading == n.Type && "1" == n.IALAttr("fold") {
|
||||
if ast.NodeHeading != node.Type {
|
||||
return true
|
||||
}
|
||||
if n.HeadingLevel > node.HeadingLevel {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func HeadingChildren(heading *ast.Node) (ret []*ast.Node) {
|
||||
start := heading.Next
|
||||
if nil == start {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue