🎨 查询嵌入块支持设置是否显示面包屑 https://github.com/siyuan-note/siyuan/issues/6184

This commit is contained in:
Liang Ding 2022-10-17 10:52:27 +08:00
parent c5e3a6ecf4
commit 25432c6912
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 25 additions and 8 deletions

View file

@ -381,7 +381,7 @@ func getBlock(id string) (ret *Block, err error) {
return
}
func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, headingMode int) (block *Block, blockPaths []*BlockPath) {
func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, headingMode int, breadcrumb bool) (block *Block, blockPaths []*BlockPath) {
tree, _ := trees[sqlBlock.RootID]
if nil == tree {
tree, _ = loadTreeByBlockID(sqlBlock.RootID)
@ -434,8 +434,15 @@ func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, heading
luteEngine.RenderOptions.ProtyleContenteditable = false // 不可编辑
dom := renderBlockDOMByNodes(nodes, luteEngine)
block = &Block{Box: def.Box, Path: def.Path, HPath: b.HPath, ID: def.ID, Type: def.Type.String(), Content: dom}
if Conf.Editor.EmbedBlockBreadcrumb {
blockPaths = buildBlockBreadcrumb(def)
defBreadCrumb := def.IALAttr("breadcrumb")
if "" != defBreadCrumb {
if "true" == defBreadCrumb {
blockPaths = buildBlockBreadcrumb(def)
}
} else {
if Conf.Editor.EmbedBlockBreadcrumb {
blockPaths = buildBlockBreadcrumb(def)
}
}
if 1 > len(blockPaths) {
blockPaths = []*BlockPath{}