Skip to content

Commit

Permalink
🐛 The super block below the folded heading contains headings of the s…
Browse files Browse the repository at this point in the history
…ame level and cannot be loaded Fix #9162
  • Loading branch information
88250 committed Sep 11, 2023
1 parent cf5fc40 commit ccc9bc6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions kernel/treenode/heading.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ func MoveFoldHeading(updateNode, oldNode *ast.Node) {
}

func IsInFoldedHeading(node, currentHeading *ast.Node) bool {
if nil == node {
return false
}

if ast.NodeSuperBlock == node.Type {
// The super block below the folded heading contains headings of the same level and cannot be loaded https://github.com/siyuan-note/siyuan/issues/9162
if nil == currentHeading {
return false
}

sbChildHeading := SuperBlockHeading(node)
if nil != sbChildHeading {
if sbChildHeading.HeadingLevel <= currentHeading.HeadingLevel {
return false
}
}
}

heading := HeadingParent(node)
if nil == heading {
return false
Expand Down

0 comments on commit ccc9bc6

Please sign in to comment.