Explorar o código

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

Liang Ding %!s(int64=2) %!d(string=hai) anos
pai
achega
38d88f6960
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      kernel/model/search.go

+ 2 - 2
kernel/model/search.go

@@ -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