Skip to content

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

:bug: 双击打开图片不对 Fix https://github.com/siyuan-note/siyuan/issues/5876

Liang Ding9fc80a5edde3
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 076420bc60..491b1b5751 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -58,6 +58,9 @@ func DocImageAssets(rootID string) (ret []string, err error) {
if ast.NodeImage == n.Type {
linkDest := n.ChildByType(ast.NodeLinkDest)
dest := linkDest.Tokens
+ if 1 > len(dest) { // 双击打开图片不对 https://github.com/siyuan-note/siyuan/issues/5876
+ return ast.WalkContinue
+ }
ret = append(ret, gulu.Str.FromBytes(dest))
}
return ast.WalkContinue