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

This commit is contained in:
Liang Ding 2022-10-17 23:20:05 +08:00
parent 9f0fcd8cbc
commit 38d88f6960
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -682,8 +682,8 @@ func markReplaceSpan(text string, keywords []string, replacementStart, replaceme
return
}
// 包含非 ASCII 字符时再试试不分词匹配
if !gulu.Str.IsASCII(text) {
// 包含非 ASCII 字符或者空格时再试试不分词匹配
if !gulu.Str.IsASCII(text) || strings.Contains(text, " ") {
ret = search.EncloseHighlighting(text, keywords, replacementStart, replacementEnd, Conf.Search.CaseSensitive)
}
return