Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/13677

Vanessac70bf3571f36
diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts
index ccef5e2c92..771469c262 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();