From 45a4d05c9f547e236538950436a74dc66c9f88f9 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 16 Oct 2024 22:52:32 +0800 Subject: [PATCH] :bug: Replace fails when search results contain mixed case in text elements https://github.com/siyuan-note/siyuan/issues/9171 --- 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 cd7258860..751051193 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -834,7 +834,7 @@ func replaceTextNode(text *ast.Node, method int, keyword string, replacement str // Replace fails when search results contain mixed case in text elements https://github.com/siyuan-note/siyuan/issues/9171 keywords := strings.Split(keyword, " ") // keyword 可能是 "foo Foo" 使用空格分隔的大小写命中情况,这里统一转换小写后去重 - if 1 < len(keywords) { + if 0 < len(keywords) { var lowerKeywords []string for _, k := range keywords { lowerKeywords = append(lowerKeywords, strings.ToLower(k))