🎨 Improve list block navigation https://github.com/siyuan-note/siyuan/issues/11193
This commit is contained in:
parent
540ad2e535
commit
a37bc3335d
1 changed files with 4 additions and 5 deletions
|
@ -130,12 +130,11 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
|||
}
|
||||
|
||||
parentListCount := 0
|
||||
var parentList, parentListItem, current *ast.Node
|
||||
var parentListItem, current *ast.Node
|
||||
for p := node.Parent; nil != p; p = p.Parent {
|
||||
if ast.NodeListItem == p.Type {
|
||||
parentListCount++
|
||||
if 1 < parentListCount {
|
||||
parentList = p.Parent
|
||||
parentListItem = p
|
||||
break
|
||||
}
|
||||
|
@ -143,9 +142,9 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
|||
}
|
||||
}
|
||||
|
||||
if nil != parentList {
|
||||
parent = parentList.ID
|
||||
if flb := firstChild(parentList); nil != flb {
|
||||
if nil != parentListItem {
|
||||
parent = parentListItem.ID
|
||||
if flb := firstChild(parentListItem); nil != flb {
|
||||
parent = flb.ID
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue