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

This commit is contained in:
Daniel 2024-11-20 16:16:31 +08:00
parent 8a6733e5b5
commit 247b534aa0
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -614,7 +614,11 @@ func matchBacklinkKeyword(block *Block, keywords []string) bool {
for _, k := range keywords {
k = strings.ToLower(k)
if strings.Contains(strings.ToLower(block.FContent), k) ||
content := block.Content
if block.IsContainerBlock() {
content = block.FContent
}
if strings.Contains(strings.ToLower(content), k) ||
strings.Contains(strings.ToLower(path.Base(block.HPath)), k) ||
strings.Contains(strings.ToLower(block.Name), k) ||
strings.Contains(strings.ToLower(block.Alias), k) ||