Skip to content

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

:bug: Virtual reference keyword exclusion list does not work in certain cases https://github.com/siyuan-note/siyuan/issues/15252

Danielbdc48a6d246e
diff --git a/kernel/model/virutalref.go b/kernel/model/virutalref.go
index 88f7319b3f..67a8990286 100644
--- a/kernel/model/virutalref.go
+++ b/kernel/model/virutalref.go
@@ -252,12 +252,16 @@ func getVirtualRefKeywords(root *ast.Node) (ret []string) {
if 0 < len(regexps) {
tmp = nil
for _, str := range ret {
+ matchExclude := false
for _, re := range regexps {
- if ok, regErr := regexp.MatchString(re, str); !ok && nil == regErr {
- tmp = append(tmp, str)
+ if ok, _ := regexp.MatchString(re, str); ok {
+ matchExclude = true
break
}
}
+ if !matchExclude {
+ tmp = append(tmp, str)
+ }
}
ret = tmp
}