From 78c4e7884328ccc58bc2878d43dab420bc71c13c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 19 May 2023 11:33:29 +0800 Subject: [PATCH] :art: Improve search result highlight and positioning https://github.com/siyuan-note/siyuan/issues/8274 --- kernel/model/file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/model/file.go b/kernel/model/file.go index e397c3b4f..2c7ff6b16 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -674,6 +674,9 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s var keywords []string if 0 == queryMethod || 1 == queryMethod { // 只有关键字搜索和查询语法搜索才支持高亮 + if 0 == queryMethod { + query = stringQuery(query) + } typeFilter := buildTypeFilter(queryTypes) keywords = highlightByQuery(query, typeFilter, rootID) }