mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 08:00:13 +01:00
🎨 Improve block custom attribute search preview area positioning https://github.com/siyuan-note/siyuan/issues/14061
This commit is contained in:
parent
2e284537c4
commit
6e7168a8f7
1 changed files with 7 additions and 1 deletions
|
|
@ -1525,7 +1525,9 @@ func highlightByFTS(query, typeFilter, id string) (ret []string) {
|
||||||
"highlight(" + table + ", 9, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS memo, " +
|
"highlight(" + table + ", 9, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS memo, " +
|
||||||
"highlight(" + table + ", 10, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS tag, " +
|
"highlight(" + table + ", 10, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS tag, " +
|
||||||
"highlight(" + table + ", 11, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS content, " +
|
"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 := "SELECT " + projections + " FROM " + table + " WHERE (`" + table + "` MATCH '" + columnFilter() + ":(" + query + ")'"
|
||||||
stmt += ") AND type IN " + typeFilter
|
stmt += ") AND type IN " + typeFilter
|
||||||
stmt += " AND root_id = '" + id + "'"
|
stmt += " AND root_id = '" + id + "'"
|
||||||
|
|
@ -1552,6 +1554,10 @@ func highlightByFTS(query, typeFilter, id string) (ret []string) {
|
||||||
if 0 < len(keyword) {
|
if 0 < len(keyword) {
|
||||||
ret = append(ret, 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)
|
keyword = gulu.Str.SubstringsBetween(block.Content, search.SearchMarkLeft, search.SearchMarkRight)
|
||||||
if 0 < len(keyword) {
|
if 0 < len(keyword) {
|
||||||
ret = append(ret, keyword...)
|
ret = append(ret, keyword...)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue