mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 10:51:36 +08:00
🎨 Improve database block text in breadcrumbs https://github.com/siyuan-note/siyuan/issues/10891
This commit is contained in:
parent
4f6a2e750f
commit
1d2516afb9
@ -365,7 +365,7 @@ func buildBlockBreadcrumb(node *ast.Node, excludeTypes []string) (ret []*BlockPa
|
|||||||
if ast.NodeDocument == parent.Type {
|
if ast.NodeDocument == parent.Type {
|
||||||
name = box.Name + hPath
|
name = box.Name + hPath
|
||||||
} else if ast.NodeAttributeView == parent.Type {
|
} else if ast.NodeAttributeView == parent.Type {
|
||||||
name = treenode.GetAttributeViewName(parent.AttributeViewID)
|
name, _ = av.GetAttributeViewName(parent.AttributeViewID)
|
||||||
} else {
|
} else {
|
||||||
if "" == name {
|
if "" == name {
|
||||||
if ast.NodeListItem == parent.Type {
|
if ast.NodeListItem == parent.Type {
|
||||||
|
@ -546,27 +546,6 @@ func IsChartCodeBlockCode(code *ast.Node) bool {
|
|||||||
return render.NoHighlight(language)
|
return render.NoHighlight(language)
|
||||||
}
|
}
|
||||||
|
|
||||||
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{}
|
|
||||||
for _, v := range attrView.Views {
|
|
||||||
buf.WriteString(v.Name)
|
|
||||||
buf.WriteByte(' ')
|
|
||||||
}
|
|
||||||
|
|
||||||
name = strings.TrimSpace(buf.String())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAttributeViewContent(avID string) (content string) {
|
func getAttributeViewContent(avID string) (content string) {
|
||||||
if "" == avID {
|
if "" == avID {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user