Skip to content

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

:art: 反链面板支持过滤关键字高亮 Fix https://github.com/siyuan-note/siyuan/issues/7028

Liang Ding11fabe83adf2
diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go
index 2fd61ce5c3..5272bf8e98 100644
--- a/kernel/model/backlink.go
+++ b/kernel/model/backlink.go
@@ -69,6 +69,7 @@ type Backlink struct {
}
func GetBackmentionDoc(defID, refTreeID, keyword string) (ret []*Backlink) {
+ keyword = strings.TrimSpace(keyword)
ret = []*Backlink{}
beforeLen := 12
sqlBlock := sql.GetBlock(defID)
@@ -90,6 +91,11 @@ func GetBackmentionDoc(defID, refTreeID, keyword string) (ret []*Backlink) {
mentions = append(mentions, mention)
}
}
+
+ if "" != keyword {
+ mentionKeywords = append(mentionKeywords, keyword)
+ }
+ mentionKeywords = gulu.Str.RemoveDuplicatedElem(mentionKeywords)
for _, mention := range mentions {
refTree := treeCache[mention.RootID]
if nil == refTree {