Vanessa 2025-01-15 10:58:22 +08:00
parent db60169f1d
commit c70bf3571f

View File

@ -54,12 +54,13 @@ export const resize = (protyle: IProtyle) => {
}
});
}
protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber__rows").forEach((item: HTMLElement) => {
if ((item.nextElementSibling as HTMLElement).style.wordBreak === "break-word") {
lineNumberRender(item.parentElement);
}
});
}
// 小于 MIN_ABS 也会导致换行 https://github.com/siyuan-note/siyuan/issues/13677
protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber__rows").forEach((item: HTMLElement) => {
if ((item.nextElementSibling as HTMLElement).style.wordBreak === "break-word") {
lineNumberRender(item.parentElement);
}
});
const topElement = protyle.wysiwyg.element.querySelector("[data-resize-top]");
if (topElement) {
topElement.scrollIntoView();