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/5642

Liang Dingf9bc907edf91
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 734c6b833f..b216aad6f3 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -694,13 +694,17 @@ func assetsLinkDestsInTree(tree *parse.Tree) (ret []string) {
} else { // HTMLBlock/InlineHTML/IFrame/Audio/Video
if index := bytes.Index(n.Tokens, []byte("src=\"")); 0 < index {
src := n.Tokens[index+len("src=\""):]
- src = src[:bytes.Index(src, []byte("\""))]
- if !isRelativePath(src) {
- return ast.WalkContinue
- }
+ if index = bytes.Index(src, []byte("\"")); 0 < index {
+ src = src[:bytes.Index(src, []byte("\""))]
+ if !isRelativePath(src) {
+ return ast.WalkContinue
+ }
- dest := strings.TrimSpace(string(src))
- ret = append(ret, dest)
+ dest := strings.TrimSpace(string(src))
+ ret = append(ret, dest)
+ } else {
+ logging.LogWarnf("src is missing the closing double quote in tree [%s] ", tree.Box+tree.Path)
+ }
}
}
}