From c5136f28f1cfd5e4e0a32d9e9e8b4ac5492c2f10 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 12 Mar 2025 23:25:07 +0800 Subject: [PATCH] :bug: Flashcard management will be incorrectly highlighted after global search https://github.com/siyuan-note/siyuan/issues/13898 --- kernel/sql/cache.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sql/cache.go b/kernel/sql/cache.go index b9ca037f4..28b334494 100644 --- a/kernel/sql/cache.go +++ b/kernel/sql/cache.go @@ -17,6 +17,7 @@ package sql import ( + "strings" "time" "github.com/88250/lute/ast" @@ -25,6 +26,7 @@ import ( "github.com/jinzhu/copier" gcache "github.com/patrickmn/go-cache" "github.com/siyuan-note/logging" + "github.com/siyuan-note/siyuan/kernel/search" ) var cacheDisabled = true @@ -57,6 +59,8 @@ func putBlockCache(block *Block) { logging.LogErrorf("clone block failed: %v", err) return } + cloned.Content = strings.ReplaceAll(cloned.Content, search.SearchMarkLeft, "") + cloned.Content = strings.ReplaceAll(cloned.Content, search.SearchMarkRight, "") blockCache.Set(cloned.ID, cloned, 1) }