An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: 改进虚拟引用和反链提及搜索匹配 Fix https://github.com/siyuan-note/siyuan/issues/6600
Liang Ding9bd3f1ad2e6f
diff --git a/kernel/search/mark.go b/kernel/search/mark.goindex e16fe6fa43..e858f3fa5c 100644--- a/kernel/search/mark.go+++ b/kernel/search/mark.go@@ -85,7 +85,7 @@ func EncloseHighlighting(text string, keywords []string, openMark, closeMark str}re := ic + "("for i, k := range keywords {- k = keyword2regexp(k)+ k = regexp.QuoteMeta(k)re += "(" + k + ")"if i < len(keywords)-1 {re += "|"@@ -98,7 +98,7 @@ func EncloseHighlighting(text string, keywords []string, openMark, closeMark str})} else {for _, k := range keywords {- k = keyword2regexp(k)+ k = regexp.QuoteMeta(k)var repls, words []stringif re, err := regexp.Compile(ic + k); nil == err {words = re.FindAllString(text, -1)@@ -115,12 +115,3 @@ func EncloseHighlighting(text string, keywords []string, openMark, closeMark str}return text}--func keyword2regexp(k string) string {- k = strings.ReplaceAll(k, "*", ".*")- k = strings.ReplaceAll(k, "?", ".")- k = strings.ReplaceAll(k, "%", ".*")- k = strings.ReplaceAll(k, "_", ".")- k = strings.ReplaceAll(k, "\\\\", "\\")- return k-}