From 597c166c430c1e33bf1db438f7b73d0e808d99c9 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 9 Nov 2024 15:20:01 +0800 Subject: [PATCH] :art: The backlink panel supports filtering by the document name https://github.com/siyuan-note/siyuan/issues/12985 --- kernel/model/backlink.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go index 13eb3749b..b277e08a7 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 }