🎨 Display database title in bookmark panel https://github.com/siyuan-note/siyuan/issues/11666

This commit is contained in:
Daniel 2024-06-12 10:20:17 +08:00
parent 11df239bd2
commit 511a4bdd8a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 9 additions and 3 deletions

View file

@ -22,8 +22,10 @@ import (
"sort"
"strings"
"github.com/88250/gulu"
"github.com/88250/lute/parse"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/av"
"github.com/siyuan-note/siyuan/kernel/cache"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/treenode"
@ -171,6 +173,10 @@ func BuildBookmark() (ret *Bookmarks) {
if "" != block.Name {
// Blocks in the bookmark panel display their name instead of content https://github.com/siyuan-note/siyuan/issues/8514
block.Content = block.Name
} else if "NodeAttributeView" == block.Type {
// Display database title in bookmark panel https://github.com/siyuan-note/siyuan/issues/11666
avID := gulu.Str.SubStringBetween(block.Markdown, "av-id=\"", "\"")
block.Content, _ = av.GetAttributeViewName(avID)
} else {
// Improve bookmark panel rendering https://github.com/siyuan-note/siyuan/issues/9361
tree, err := LoadTreeByBlockID(block.ID)