mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 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) => {
|
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst = false) => {
|
||||||
|
if (1 > blockPaths.length) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
let html = "";
|
let html = "";
|
||||||
blockPaths.forEach((item, index) => {
|
blockPaths.forEach((item, index) => {
|
||||||
if (index === 0 && !renderFirst) {
|
if (index === 0 && !renderFirst) {
|
||||||
|
|
|
||||||
|
|
@ -170,11 +170,13 @@ func buildBacklink(refID string, refTree *parse.Tree, keywords []string, luteEng
|
||||||
}
|
}
|
||||||
|
|
||||||
dom := renderBlockDOMByNodes(renderNodes, luteEngine)
|
dom := renderBlockDOMByNodes(renderNodes, luteEngine)
|
||||||
ret = &Backlink{
|
blockPaths := []*BlockPath{}
|
||||||
DOM: dom,
|
if nil != n.Parent && nil != n.Parent.Parent {
|
||||||
BlockPaths: buildBlockBreadcrumb(n, nil),
|
// 仅在多余一层时才显示面包屑,这样界面展示更加简洁
|
||||||
Expand: expand,
|
// 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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue