🐛 Replace fails when search results contain mixed case in text elements https://github.com/siyuan-note/siyuan/issues/9171

This commit is contained in:
Daniel 2024-10-16 22:52:32 +08:00
parent 61c849af56
commit 45a4d05c9f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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))