Skip to content

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

:bug: 搜索结果未转义导致脚本执行或白屏 Fix https://github.com/siyuan-note/siyuan/issues/5492

Liang Dingc2caef8d496c
diff --git a/kernel/search/mark.go b/kernel/search/mark.go
index 59a58399e1..b3fd6234c6 100644
--- a/kernel/search/mark.go
+++ b/kernel/search/mark.go
@@ -26,7 +26,7 @@ import (
func MarkText(text string, keyword string, beforeLen int, caseSensitive bool) (pos int, marked string) {
if "" == keyword {
- return -1, text
+ return -1, html.EscapeString(text)
}
text = html.EscapeString(text)
keywords := SplitKeyword(keyword)