From e01077f300146356f921561cb080414338e8ecf6 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 2 Aug 2023 20:47:09 +0800 Subject: [PATCH] :art: Block ref search supports searching `'` Fix https://github.com/siyuan-note/siyuan/issues/8886 --- kernel/model/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/search.go b/kernel/model/search.go index 88f75057a..06ce3dfbc 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -710,7 +710,7 @@ func fullTextSearchRefBlock(keyword string, beforeLen int, onlyDoc bool) (ret [] when memo LIKE '%${keyword}%' then 90 when content LIKE '%${keyword}%' and type != 'i' and type != 'l' then 100 else 65535 end ASC, sort ASC, length ASC` - orderBy = strings.ReplaceAll(orderBy, "${keyword}", keyword) + orderBy = strings.ReplaceAll(orderBy, "${keyword}", quotedKeyword) stmt += orderBy + " LIMIT " + strconv.Itoa(Conf.Search.Limit) blocks := sql.SelectBlocksRawStmtNoParse(stmt, Conf.Search.Limit) ret = fromSQLBlocks(&blocks, "", beforeLen)