Skip to content

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

:bug: Search and replace fails in some cases https://github.com/siyuan-note/siyuan/issues/10016

Daniele11b9356c34a
diff --git a/kernel/model/search.go b/kernel/model/search.go
index 185df57a90..d3546e565e 100644
--- a/kernel/model/search.go
+++ b/kernel/model/search.go
@@ -562,6 +562,13 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
n.TextMarkInlineMemoContent = r.ReplaceAllString(n.TextMarkInlineMemoContent, replacement)
}
}
+ } else if n.IsTextMarkType("text") {
+ // Search and replace fails in some cases https://github.com/siyuan-note/siyuan/issues/10016
+ if !replaceTypes["text"] {
+ return ast.WalkContinue
+ }
+
+ replaceNodeTextMarkTextContent(n, method, keyword, replacement, r)
}
}
return ast.WalkContinue