mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 Improve search result highlight and positioning https://github.com/siyuan-note/siyuan/issues/8274
This commit is contained in:
parent
8f689502ec
commit
78c4e78843
1 changed files with 3 additions and 0 deletions
|
|
@ -674,6 +674,9 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s
|
||||||
|
|
||||||
var keywords []string
|
var keywords []string
|
||||||
if 0 == queryMethod || 1 == queryMethod { // 只有关键字搜索和查询语法搜索才支持高亮
|
if 0 == queryMethod || 1 == queryMethod { // 只有关键字搜索和查询语法搜索才支持高亮
|
||||||
|
if 0 == queryMethod {
|
||||||
|
query = stringQuery(query)
|
||||||
|
}
|
||||||
typeFilter := buildTypeFilter(queryTypes)
|
typeFilter := buildTypeFilter(queryTypes)
|
||||||
keywords = highlightByQuery(query, typeFilter, rootID)
|
keywords = highlightByQuery(query, typeFilter, rootID)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue