mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 08:46:09 +01:00
🎨 位于超级块中的嵌入块不显示面包屑 Fix https://github.com/siyuan-note/siyuan/issues/6258
This commit is contained in:
parent
4b84d6abd1
commit
6352273052
5 changed files with 22 additions and 9 deletions
|
|
@ -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, breadcrumb bool) (block *Block, blockPaths []*BlockPath) {
|
||||
func getEmbeddedBlock(embedBlockID string, 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)
|
||||
|
|
@ -393,6 +393,14 @@ func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, heading
|
|||
if nil == def {
|
||||
return
|
||||
}
|
||||
embedNodeTree, _ := loadTreeByBlockID(embedBlockID)
|
||||
if nil == embedNodeTree {
|
||||
return
|
||||
}
|
||||
embedNode := treenode.GetNodeInTree(embedNodeTree, embedBlockID)
|
||||
if nil == embedNode {
|
||||
return
|
||||
}
|
||||
|
||||
var unlinks, nodes []*ast.Node
|
||||
ast.Walk(def, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
|
|
@ -434,9 +442,12 @@ 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 breadcrumb {
|
||||
blockPaths = buildBlockBreadcrumb(def)
|
||||
|
||||
// 位于超级块中的嵌入块不显示面包屑 https://github.com/siyuan-note/siyuan/issues/6258
|
||||
inSuperBlock := embedNode.ParentIs(ast.NodeSuperBlock)
|
||||
|
||||
if breadcrumb && !inSuperBlock {
|
||||
blockPaths = buildBlockBreadcrumb(def)
|
||||
}
|
||||
if 1 > len(blockPaths) {
|
||||
blockPaths = []*BlockPath{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue