🎨 The backlink panel no longer displays breadcrumbs of the first-level blocks https://github.com/siyuan-note/siyuan/issues/12862
This commit is contained in:
parent
8b63066430
commit
b1e7908b19
2 changed files with 10 additions and 4 deletions
|
@ -100,6 +100,10 @@ export const getBacklinkHeadingMore = (moreElement: HTMLElement) => {
|
|||
};
|
||||
|
||||
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst = false) => {
|
||||
if (1 > blockPaths.length) {
|
||||
return "";
|
||||
}
|
||||
|
||||
let html = "";
|
||||
blockPaths.forEach((item, index) => {
|
||||
if (index === 0 && !renderFirst) {
|
||||
|
|
|
@ -170,11 +170,13 @@ func buildBacklink(refID string, refTree *parse.Tree, keywords []string, luteEng
|
|||
}
|
||||
|
||||
dom := renderBlockDOMByNodes(renderNodes, luteEngine)
|
||||
ret = &Backlink{
|
||||
DOM: dom,
|
||||
BlockPaths: buildBlockBreadcrumb(n, nil),
|
||||
Expand: expand,
|
||||
blockPaths := []*BlockPath{}
|
||||
if nil != n.Parent && nil != n.Parent.Parent {
|
||||
// 仅在多余一层时才显示面包屑,这样界面展示更加简洁
|
||||
// The backlink panel no longer displays breadcrumbs of the first-level blocks https://github.com/siyuan-note/siyuan/issues/12862
|
||||
blockPaths = buildBlockBreadcrumb(n, nil)
|
||||
}
|
||||
ret = &Backlink{DOM: dom, BlockPaths: blockPaths, Expand: expand}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue