Vanessa 2024-10-21 23:53:58 +08:00
parent c9f5a2de3d
commit 66f711d48d

View file

@ -16,7 +16,7 @@ export const renderBacklink = (protyle: IProtyle, backlinkData: {
protyle.block.showAll = true;
let html = "";
backlinkData.forEach(item => {
html += genBreadcrumb(item.blockPaths) + setBacklinkFold(item.dom, item.expand);
html += genBreadcrumb(item.blockPaths, false, backlinkData.length) + setBacklinkFold(item.dom, item.expand);
});
protyle.wysiwyg.element.innerHTML = html;
processRender(protyle.wysiwyg.element);
@ -99,9 +99,9 @@ export const getBacklinkHeadingMore = (moreElement: HTMLElement) => {
moreElement.remove();
};
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst = false) => {
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst: boolean, parentLength?: number) => {
if (1 > blockPaths.length) {
return '<div contenteditable="false" style="border-top: 1px solid var(--b3-border-color);min-height: 0;width: 100%;" class="protyle-breadcrumb__bar"><span></span></div>';
return `<div contenteditable="false" style="border-top: ${parentLength === 1 ? 0 : 1}px solid var(--b3-border-color);min-height: 0;width: 100%;" class="protyle-breadcrumb__bar"><span></span></div>`;
}
let html = "";