Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/15833 point 2

Danieleca318c4ff2f
diff --git a/kernel/model/block.go b/kernel/model/block.go
index ed78bb87a5..4e35284e71 100644
--- a/kernel/model/block.go
+++ b/kernel/model/block.go
@@ -234,6 +234,22 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
next = flb.ID
}
}
+
+ if "" == previous && "" == next && nil != current {
+ parent = current.ID
+ if nil != current.Previous {
+ previous = current.Previous.ID
+ if flb := treenode.FirstChildBlock(current.Previous); nil != flb {
+ previous = flb.ID
+ }
+ }
+ if nil != current.Next {
+ next = current.Next.ID
+ if flb := treenode.FirstChildBlock(current.Next); nil != flb {
+ next = flb.ID
+ }
+ }
+ }
return
}