mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 13:28:48 +01:00
This commit is contained in:
parent
6be604cd85
commit
962493216f
2 changed files with 4 additions and 4 deletions
|
|
@ -36,8 +36,8 @@ export const blockRender = (protyle: IProtyle, element: Element) => {
|
|||
rotateElement.classList.remove("fn__rotate");
|
||||
}
|
||||
let html = "";
|
||||
response.data.blocks.forEach((blocksItem: { block: IBlock, blockPath: IBreadcrumb[] }) => {
|
||||
html += `<div class="protyle-wysiwyg__embed" data-id="${blocksItem.block.id}">${genBreadcrumb(blocksItem.blockPath)}${blocksItem.block.content}</div>`;
|
||||
response.data.blocks.forEach((blocksItem: { block: IBlock, blockPaths: IBreadcrumb[] }) => {
|
||||
html += `<div class="protyle-wysiwyg__embed" data-id="${blocksItem.block.id}">${genBreadcrumb(blocksItem.blockPaths, true)}${blocksItem.block.content}</div>`;
|
||||
});
|
||||
item.setAttribute("data-render", "true");
|
||||
if (response.data.blocks.length > 0) {
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ export const getBacklinkHeadingMore = (moreElement: HTMLElement) => {
|
|||
moreElement.remove();
|
||||
};
|
||||
|
||||
export const genBreadcrumb = (blockPaths: IBreadcrumb[]) => {
|
||||
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst = false) => {
|
||||
let html = "";
|
||||
blockPaths.forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
if (index === 0 && !renderFirst) {
|
||||
return;
|
||||
}
|
||||
html += `<span class="protyle-breadcrumb__item${index === blockPaths.length - 1 ? " protyle-breadcrumb__item--active" : ""}" data-id="${item.id}">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue