Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-09-29 18:29:03 +08:00
parent 36a31c0503
commit f6f58a0719
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 28 additions and 47 deletions

View file

@ -86,6 +86,10 @@ func GetHeadingFold(nodes []*ast.Node) (ret []*ast.Node) {
}
func GetParentFoldedHeading(node *ast.Node) (parentFoldedHeading *ast.Node) {
if nil == node {
return
}
currentLevel := 7
if ast.NodeHeading == node.Type {
currentLevel = node.HeadingLevel