Skip to content

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

:art: The backlink panel supports filtering by the document name https://github.com/siyuan-note/siyuan/issues/12985

Daniel597c166c430c
diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go
index 13eb3749b1..b277e08a7f 100644
--- a/kernel/model/backlink.go
+++ b/kernel/model/backlink.go
@@ -571,7 +571,7 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keyword string) (ret []*Bl
if nil != refBlock && p.FContent == refBlock.Content { // 使用内容判断是否是列表项下第一个子块
// 如果是列表项下第一个子块,则后续会通过列表项传递或关联处理,所以这里就不处理这个段落了
processedParagraphs.Add(p.ID)
- if !strings.Contains(p.Content, keyword) {
+ if !strings.Contains(p.Content, keyword) && !strings.Contains(path.Base(p.HPath), keyword) {
refsCount--
continue
}
@@ -587,7 +587,7 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keyword string) (ret []*Bl
}
}
- if !strings.Contains(ref.Content, keyword) {
+ if !strings.Contains(ref.Content, keyword) && !strings.Contains(path.Base(ref.HPath), keyword) {
refsCount--
continue
}