🎨 Improve dynamic anchor text for db node https://github.com/siyuan-note/siyuan/issues/10880
This commit is contained in:
parent
8423f92f0e
commit
984911b7d0
1 changed files with 2 additions and 23 deletions
|
@ -182,7 +182,8 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
|
|||
return getAttributeViewContent(node.AttributeViewID)
|
||||
}
|
||||
|
||||
return getAttributeViewName(node.AttributeViewID)
|
||||
ret, _ := av.GetAttributeViewName(node.AttributeViewID)
|
||||
return ret
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
|
@ -566,28 +567,6 @@ func GetAttributeViewName(avID string) (name string) {
|
|||
return
|
||||
}
|
||||
|
||||
func getAttributeViewName(avID string) (name string) {
|
||||
if "" == avID {
|
||||
return
|
||||
}
|
||||
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
|
||||
return
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
buf.WriteString(attrView.Name)
|
||||
buf.WriteByte(' ')
|
||||
for _, v := range attrView.Views {
|
||||
buf.WriteString(v.Name)
|
||||
buf.WriteByte(' ')
|
||||
}
|
||||
name = strings.TrimSpace(buf.String())
|
||||
return
|
||||
}
|
||||
|
||||
func getAttributeViewContent(avID string) (content string) {
|
||||
if "" == avID {
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue