This commit is contained in:
Liang Ding 2022-11-21 22:41:44 +08:00
parent f23cd5005d
commit 5afffdb0f7
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 34 additions and 0 deletions

View file

@ -252,6 +252,25 @@ func GetHeadingDeleteTransaction(id string) (transaction *Transaction, err error
return
}
func GetHeadingChildrenIDs(id string) (ret []string) {
tree, err := loadTreeByBlockID(id)
if nil != err {
return
}
heading := treenode.GetNodeInTree(tree, id)
if nil == heading || ast.NodeHeading != heading.Type {
return
}
nodes := append([]*ast.Node{}, heading)
children := treenode.HeadingChildren(heading)
nodes = append(nodes, children...)
for _, n := range nodes {
ret = append(ret, n.ID)
}
return
}
func GetHeadingChildrenDOM(id string) (ret string) {
tree, err := loadTreeByBlockID(id)
if nil != err {