Skip to content

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

:bug: Fix backmention highlighting https://github.com/siyuan-note/siyuan/issues/13324

Daniel2292f1a0a500
diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go
index 09417921bb..04ef857bb2 100644
--- a/kernel/model/backlink.go
+++ b/kernel/model/backlink.go
@@ -94,7 +94,9 @@ func GetBackmentionDoc(defID, refTreeID, keyword string, containChildren bool) (
}
mentionBlockIDs = gulu.Str.RemoveDuplicatedElem(mentionBlockIDs)
- mentionKeywords = strings.Split(keyword, " ")
+ if "" != keyword {
+ mentionKeywords = append(mentionKeywords, strings.Split(keyword, " ")...)
+ }
mentionKeywords = gulu.Str.RemoveDuplicatedElem(mentionKeywords)
var refTree *parse.Tree