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

This commit is contained in:
Daniel 2024-11-09 15:20:01 +08:00
parent 2da780a04e
commit 597c166c43
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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
}