Skip to content

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

:art: Add internal kernel API `/api/block/getBlocksIndexes` https://github.com/siyuan-note/siyuan/issues/10608

Daniel1d3e28da6fe2
diff --git a/kernel/model/blockinfo.go b/kernel/model/blockinfo.go
index fb13ebaae0..cd3702dd2c 100644
--- a/kernel/model/blockinfo.go
+++ b/kernel/model/blockinfo.go
@@ -293,11 +293,14 @@ func GetBlocksIndexes(ids []string) (ret map[string]int) {
}
if !n.IsChildBlockOf(tree.Root, 1) {
+ if n.IsBlock() {
+ nodesIndexes[n.ID] = idx
+ }
return ast.WalkContinue
}
- nodesIndexes[n.ID] = idx
idx++
+ nodesIndexes[n.ID] = idx
return ast.WalkContinue
})