Skip to content

Commit

Permalink
🎨 The backlink panel supports filtering by the block attributes #12985
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 11, 2024
1 parent 7e3e1d0 commit ea3f5fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/model/backlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ 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) && !strings.Contains(path.Base(p.HPath), keyword) {
if !strings.Contains(p.Content, keyword) && !strings.Contains(path.Base(p.HPath), keyword) &&
!strings.Contains(p.Name, keyword) && !strings.Contains(p.Alias, keyword) && !strings.Contains(p.Memo, keyword) && !strings.Contains(p.Tag, keyword) {
refsCount--
continue
}
Expand All @@ -587,7 +588,8 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keyword string) (ret []*Bl
}
}

if !strings.Contains(ref.Content, keyword) && !strings.Contains(path.Base(ref.HPath), keyword) {
if !strings.Contains(ref.Content, keyword) && !strings.Contains(path.Base(ref.HPath), keyword) &&
!strings.Contains(ref.Name, keyword) && !strings.Contains(ref.Alias, keyword) && !strings.Contains(ref.Memo, keyword) && !strings.Contains(ref.Tag, keyword) {
refsCount--
continue
}
Expand Down

0 comments on commit ea3f5fa

Please sign in to comment.