mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🎨 Supports searching database blocks by the view title https://github.com/siyuan-note/siyuan/issues/9348
This commit is contained in:
parent
cf154dcaa1
commit
d38311c48c
5 changed files with 40 additions and 28 deletions
|
|
@ -18,6 +18,7 @@ package treenode
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/siyuan-note/siyuan/kernel/av"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
|
|
@ -139,6 +140,19 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
|
|||
|
||||
if ast.NodeDocument == node.Type {
|
||||
return node.IALAttr("title")
|
||||
} else if ast.NodeAttributeView == node.Type {
|
||||
if "" != node.AttributeViewID {
|
||||
attrView, err := av.ParseAttributeView(node.AttributeViewID)
|
||||
if nil == err {
|
||||
buf := bytes.Buffer{}
|
||||
for _, v := range attrView.Views {
|
||||
buf.WriteString(v.Name)
|
||||
buf.WriteString(" ")
|
||||
}
|
||||
return strings.TrimSpace(buf.String())
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue