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/17556

Vanessaed799763d4c6
diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.ts
index 31968b876f..50751e90e6 100644
--- a/app/src/protyle/export/util.ts
+++ b/app/src/protyle/export/util.ts
@@ -8,7 +8,7 @@ import {Dialog} from "../../dialog";
import {addScript} from "../util/addScript";
import {isMobile} from "../../util/functions";
import {Constants} from "../../constants";
-import {highlightRender} from "../render/highlightRender";
+import {highlightRender, lineNumberRender} from "../render/highlightRender";
import {processRender} from "../util/processCode";
import {isIPhone, isSafari, openByMobile, setStorageVal} from "../util/compatibility";
import {useShell} from "../../util/pathName";
@@ -52,7 +52,14 @@ export const exportImage = (id: string) => {
</div>
<div class="fn__loading"><img height="128px" width="128px" src="stage/loading-pure.svg"></div>`,
width: isMobile() ? "92vw" : "990px",
- height: "70vh"
+ height: "70vh",
+ resizeCallback() {
+ previewElement.querySelectorAll(".code-block .protyle-linenumber__rows").forEach((item: HTMLElement) => {
+ if ((item.nextElementSibling as HTMLElement).style.wordBreak === "break-word") {
+ lineNumberRender(item.parentElement);
+ }
+ });
+ }
});
exportDialog.element.setAttribute("data-key", Constants.DIALOG_EXPORTIMAGE);
const btnsElement = exportDialog.element.querySelectorAll(".b3-button");