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

This commit is contained in:
Daniel 2025-07-08 20:38:59 +08:00
parent ed6a90ab84
commit bdc48a6d24
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -252,12 +252,16 @@ func getVirtualRefKeywords(root *ast.Node) (ret []string) {
if 0 < len(regexps) { if 0 < len(regexps) {
tmp = nil tmp = nil
for _, str := range ret { for _, str := range ret {
matchExclude := false
for _, re := range regexps { for _, re := range regexps {
if ok, regErr := regexp.MatchString(re, str); !ok && nil == regErr { if ok, _ := regexp.MatchString(re, str); ok {
tmp = append(tmp, str) matchExclude = true
break break
} }
} }
if !matchExclude {
tmp = append(tmp, str)
}
} }
ret = tmp ret = tmp
} }