mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 Virtual reference keyword exclusion list does not work in certain cases https://github.com/siyuan-note/siyuan/issues/15252
This commit is contained in:
parent
ed6a90ab84
commit
bdc48a6d24
1 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue