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

This commit is contained in:
Liang Ding 2022-10-17 10:37:01 +08:00
parent 82ffe82c81
commit 3bc24f89c5
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
10 changed files with 62 additions and 35 deletions

View file

@ -381,7 +381,7 @@ func getBlock(id string) (ret *Block, err error) {
return
}
func getBlockRendered(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) (block *Block, blockPaths []*BlockPath) {
tree, _ := trees[sqlBlock.RootID]
if nil == tree {
tree, _ = loadTreeByBlockID(sqlBlock.RootID)
@ -434,6 +434,11 @@ func getBlockRendered(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}
blockPaths = buildBlockBreadcrumb(def)
if Conf.Editor.EmbedBlockBreadcrumb {
blockPaths = buildBlockBreadcrumb(def)
}
if 1 > len(blockPaths) {
blockPaths = []*BlockPath{}
}
return
}