🐛 No results found after clicking on the inline tag https://github.com/siyuan-note/siyuan/issues/13351

This commit is contained in:
Daniel 2024-12-04 20:28:01 +08:00
parent 61d69cc213
commit 2e148ef6b1
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 2 additions and 6 deletions

View file

@ -976,6 +976,7 @@ func FullTextSearchBlock(query string, boxes, paths []string, types map[string]b
return
}
query = filterQueryInvisibleChars(query)
trimQuery := strings.TrimSpace(query)
if "" != trimQuery {
query = trimQuery
@ -1223,7 +1224,6 @@ func buildTypeFilter(types map[string]bool) string {
}
func searchBySQL(stmt string, beforeLen, page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount int) {
stmt = filterQueryInvisibleChars(stmt)
stmt = strings.TrimSpace(stmt)
blocks := sql.SelectBlocksRawStmt(stmt, page, pageSize)
ret = fromSQLBlocks(&blocks, "", beforeLen)
@ -1348,7 +1348,6 @@ func extractID(content string) (ret string) {
}
func fullTextSearchByQuerySyntax(query, boxFilter, pathFilter, typeFilter, ignoreFilter, orderBy string, beforeLen, page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount int) {
query = filterQueryInvisibleChars(query)
if ast.IsNodeIDPattern(query) {
ret, matchedBlockCount, matchedRootCount = searchBySQL("SELECT * FROM `blocks` WHERE `id` = '"+query+"'", beforeLen, page, pageSize)
return
@ -1357,7 +1356,6 @@ func fullTextSearchByQuerySyntax(query, boxFilter, pathFilter, typeFilter, ignor
}
func fullTextSearchByKeyword(query, boxFilter, pathFilter, typeFilter, ignoreFilter string, orderBy string, beforeLen, page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount int) {
query = filterQueryInvisibleChars(query)
if ast.IsNodeIDPattern(query) {
ret, matchedBlockCount, matchedRootCount = searchBySQL("SELECT * FROM `blocks` WHERE `id` = '"+query+"'", beforeLen, page, pageSize)
return
@ -1366,8 +1364,6 @@ func fullTextSearchByKeyword(query, boxFilter, pathFilter, typeFilter, ignoreFil
}
func fullTextSearchByRegexp(exp, boxFilter, pathFilter, typeFilter, ignoreFilter, orderBy string, beforeLen, page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount int) {
exp = filterQueryInvisibleChars(exp)
fieldFilter := fieldRegexp(exp)
stmt := "SELECT * FROM `blocks` WHERE " + fieldFilter + " AND type IN " + typeFilter
stmt += boxFilter + pathFilter + ignoreFilter + " " + orderBy

View file

@ -62,6 +62,6 @@ func RemoveEmojiInvisible(text string) (ret string) {
func RemoveInvalid(text string) (ret string) {
ret = gulu.Str.RemoveInvisible(text)
ret = gulu.Str.RemovePUA(text)
ret = gulu.Str.RemovePUA(ret)
return
}