Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Flashcard management will be incorrectly highlighted after global search https://github.com/siyuan-note/siyuan/issues/13898

Danielc5136f28f1cf
diff --git a/kernel/sql/cache.go b/kernel/sql/cache.go
index b9ca037f47..28b3344947 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)
}