🎨 改进提及和虚拟引用搜索分词 Fix https://github.com/siyuan-note/siyuan/issues/6176

This commit is contained in:
Liang Ding 2022-10-13 12:00:29 +08:00
parent 94f5ede090
commit 0b7c6a851e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 13 additions and 2 deletions

View file

@ -649,8 +649,14 @@ func markReplaceSpan(text string, keywords []string, replacementStart, replaceme
for _, k := range keywords {
if gulu.Str.IsASCII(k) {
if part == k {
parts[i] = replacementStart + k + replacementEnd
if gulu.Str.IsASCII(part) {
if part == k {
parts[i] = replacementStart + k + replacementEnd
}
} else {
if strings.Contains(part, k) {
parts[i] = strings.ReplaceAll(part, k, replacementStart+k+replacementEnd)
}
}
} else {
if strings.Contains(part, k) {