From c70bf3571f36fa5c82a3a144d2e2042d1697bce0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 15 Jan 2025 10:58:22 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13677 --- app/src/protyle/util/resize.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts index ccef5e2c9..771469c26 100644 --- a/app/src/protyle/util/resize.ts +++ b/app/src/protyle/util/resize.ts @@ -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();