Skip to content

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

:bug: Include source root ID in embedded block results https://github.com/siyuan-note/siyuan/issues/18423

Daniel195763029bb2
diff --git a/kernel/model/block.go b/kernel/model/block.go
index c1a85f42a1..fe3ee0087e 100644
--- a/kernel/model/block.go
+++ b/kernel/model/block.go
@@ -1367,7 +1367,16 @@ func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, heading
visibleNodes := cleanRenderNodes(nodes, true)
dom := renderBlockDOMByNodes(visibleNodes, luteEngine)
content := renderBlockContentByNodes(visibleNodes)
- block = &Block{Box: def.Box, Path: def.Path, HPath: b.HPath, ID: def.ID, Type: def.Type.String(), Content: dom, Markdown: content /* 这里使用 Markdown 字段来临时存储 content */}
+ block = &Block{
+ Box: def.Box,
+ Path: def.Path,
+ HPath: b.HPath,
+ ID: def.ID,
+ RootID: b.RootID,
+ Type: def.Type.String(),
+ Content: dom,
+ Markdown: content, // 这里使用 Markdown 字段来临时存储 content
+ }
if "" != sqlBlock.IAL {
block.IAL = map[string]string{}