From 07e0eb26d2e9de3262b98f64293703068d452ff5 Mon Sep 17 00:00:00 2001 From: Tron Date: Tue, 25 Nov 2025 10:07:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/export/index.ts | 30 ++++++++++++------------- app/src/protyle/render/mindmapRender.ts | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index fdb18c7d2..0bccc9ae1 100644 --- a/app/src/protyle/export/index.ts +++ b/app/src/protyle/export/index.ts @@ -1,21 +1,21 @@ -import {hideMessage, showMessage} from "../../dialog/message"; -import {Constants} from "../../constants"; +import { hideMessage, showMessage } from "../../dialog/message"; +import { Constants } from "../../constants"; /// #if !BROWSER -import {ipcRenderer} from "electron"; +import { ipcRenderer } from "electron"; import * as fs from "fs"; import * as path from "path"; -import {afterExport} from "./util"; +import { afterExport } from "./util"; /// #endif -import {confirmDialog} from "../../dialog/confirmDialog"; -import {getThemeMode, setInlineStyle} from "../../util/assets"; -import {fetchPost, fetchSyncPost} from "../../util/fetch"; -import {Dialog} from "../../dialog"; -import {replaceLocalPath} from "../../editor/rename"; -import {getScreenWidth, isInAndroid, isInHarmony, isInIOS, setStorageVal} from "../util/compatibility"; -import {getFrontend} from "../../util/functions"; +import { confirmDialog } from "../../dialog/confirmDialog"; +import { getThemeMode, setInlineStyle } from "../../util/assets"; +import { fetchPost, fetchSyncPost } from "../../util/fetch"; +import { Dialog } from "../../dialog"; +import { replaceLocalPath } from "../../editor/rename"; +import { getScreenWidth, isInAndroid, isInHarmony, isInIOS, setStorageVal } from "../util/compatibility"; +import { getFrontend } from "../../util/functions"; const getPluginStyle = async () => { - const response = await fetchSyncPost("/api/petal/loadPetals", {frontend: getFrontend()}); + const response = await fetchSyncPost("/api/petal/loadPetals", { frontend: getFrontend() }); let css = ""; // 为加快启动速度,不进行 await response.data.forEach((item: IPluginData) => { @@ -103,7 +103,7 @@ export const saveExport = (option: IExportOptions) => { btnsElement[1].addEventListener("click", () => { const removeAssets = (wordDialog.element.querySelector("#removeAssets") as HTMLInputElement).checked; const mergeSubdocs = (wordDialog.element.querySelector("#mergeSubdocs") as HTMLInputElement).checked; - window.siyuan.storage[Constants.LOCAL_EXPORTWORD] = {removeAssets, mergeSubdocs}; + window.siyuan.storage[Constants.LOCAL_EXPORTWORD] = { removeAssets, mergeSubdocs }; setStorageVal(Constants.LOCAL_EXPORTWORD, window.siyuan.storage[Constants.LOCAL_EXPORTWORD]); getExportPath(option, removeAssets, mergeSubdocs); wordDialog.destroy(); @@ -637,7 +637,7 @@ ${getIconScript(servePath)} ${getSnippetJS()} `; - fetchPost("/api/export/exportTempContent", {content: html}, (response) => { + fetchPost("/api/export/exportTempContent", { content: html }, (response) => { ipcRenderer.send(Constants.SIYUAN_EXPORT_NEWWINDOW, response.data.url); }); }; @@ -722,7 +722,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, servePath js: `document.body.style.minWidth = "${screenWidth}px";`, css: `@page { size: A4; margin: 10mm 0 10mm 0; } .protyle-wysiwyg {padding: 0; margin: 0;}` - } : {js: "", css: ""}; + } : { js: "", css: "" }; const html = ` diff --git a/app/src/protyle/render/mindmapRender.ts b/app/src/protyle/render/mindmapRender.ts index 55e9eb1b3..b7936097d 100644 --- a/app/src/protyle/render/mindmapRender.ts +++ b/app/src/protyle/render/mindmapRender.ts @@ -3,7 +3,7 @@ import { Constants } from "../../constants"; import { hasClosestByClassName } from "../util/hasClosest"; import { genIconHTML } from "./util"; -export const mindmapRender = (element: Element, cdn = Constants.PROTYLE_CDN, markmapOptions: {zoom?: boolean; pan?: boolean} = {}) => { +export const mindmapRender = (element: Element, cdn = Constants.PROTYLE_CDN, markmapOptions: { zoom?: boolean; pan?: boolean } = {}) => { let mindmapElements: Element[] = []; if (element.getAttribute("data-subtype") === "mindmap") { // 编辑器内代码块编辑渲染