🐛 超级块下方块面包屑计算不正确 Fix https://github.com/siyuan-note/siyuan/issues/6675

This commit is contained in:
Liang Ding 2022-11-21 22:44:46 +08:00
parent 5afffdb0f7
commit ba6f0e2067
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 20 additions and 6 deletions

View file

@ -117,6 +117,14 @@ func SuperBlockHeading(sb *ast.Node) *ast.Node {
return nil
}
func SuperBlockLastHeading(sb *ast.Node) *ast.Node {
headings := sb.ChildrenByType(ast.NodeHeading)
if 0 < len(headings) {
return headings[len(headings)-1]
}
return nil
}
func HeadingParent(node *ast.Node) *ast.Node {
if nil == node {
return nil