🎨 Improve block custom attribute search preview area positioning https://github.com/siyuan-note/siyuan/issues/14061

This commit is contained in:
Daniel 2025-02-13 16:37:52 +08:00
parent 2e284537c4
commit 6e7168a8f7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1525,7 +1525,9 @@ func highlightByFTS(query, typeFilter, id string) (ret []string) {
"highlight(" + table + ", 9, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS memo, " +
"highlight(" + table + ", 10, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS tag, " +
"highlight(" + table + ", 11, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS content, " +
"fcontent, markdown, length, type, subtype, ial, sort, created, updated"
"fcontent, markdown, length, type, subtype, " +
"highlight(" + table + ", 17, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS ial, " +
"sort, created, updated"
stmt := "SELECT " + projections + " FROM " + table + " WHERE (`" + table + "` MATCH '" + columnFilter() + ":(" + query + ")'"
stmt += ") AND type IN " + typeFilter
stmt += " AND root_id = '" + id + "'"
@ -1552,6 +1554,10 @@ func highlightByFTS(query, typeFilter, id string) (ret []string) {
if 0 < len(keyword) {
ret = append(ret, keyword...)
}
keyword = gulu.Str.SubstringsBetween(block.IAL, search.SearchMarkLeft, search.SearchMarkRight)
if 0 < len(keyword) {
ret = append(ret, keyword...)
}
keyword = gulu.Str.SubstringsBetween(block.Content, search.SearchMarkLeft, search.SearchMarkRight)
if 0 < len(keyword) {
ret = append(ret, keyword...)