diff --git a/app/src/config/image.ts b/app/src/config/image.ts index 46a861af8..b37a736c0 100644 --- a/app/src/config/image.ts +++ b/app/src/config/image.ts @@ -155,7 +155,7 @@ export const image = { `; } - const isM = isMobile() + const isM = isMobile(); data.forEach((item) => { const idx = item.indexOf("assets/"); const dataPath = item.substr(idx); diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 7730eded4..7ab3d11a8 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -25,7 +25,6 @@ import {App} from "../index"; import {saveScroll} from "../protyle/scroll/saveScroll"; import {isInAndroid, isInHarmony, isInIOS, setStorageVal} from "../protyle/util/compatibility"; import {Plugin} from "../plugin"; -import {blockRender} from "../protyle/render/blockRender"; const updateTitle = (rootID: string, tab: Tab, protyle?: IProtyle) => { fetchPost("/api/block/getDocInfo", { diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index eb1f5ca8c..b7265a889 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -264,16 +264,16 @@ const promiseTransaction = () => { const updateEmbed = (protyle: IProtyle, operation: IOperation) => { let updatedEmbed = false; let html = operation.data; - const updateEmbedElements = Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-type="NodeBlockQueryEmbed"] [data-node-id="${operation.id}"]`)) + const updateEmbedElements = Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-type="NodeBlockQueryEmbed"] [data-node-id="${operation.id}"]`)); if (updateEmbedElements.length === 0) { const tempElement = document.createElement("template"); tempElement.innerHTML = operation.data; protyle.wysiwyg.element.querySelectorAll('[data-type="NodeBlockQueryEmbed"]').forEach((item) => { - item.querySelectorAll(`.protyle-wysiwyg__embed`).forEach(embedBlockItem => { - const newTempElement = tempElement.content.querySelector(`[data-node-id="${embedBlockItem.getAttribute("data-id")}"]`) + item.querySelectorAll(".protyle-wysiwyg__embed").forEach(embedBlockItem => { + const newTempElement = tempElement.content.querySelector(`[data-node-id="${embedBlockItem.getAttribute("data-id")}"]`); if (newTempElement) { - updateEmbedElements.push(embedBlockItem.querySelector('[data-node-id]')) - html = newTempElement.outerHTML + updateEmbedElements.push(embedBlockItem.querySelector("[data-node-id]")); + html = newTempElement.outerHTML; } }); }); @@ -472,7 +472,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: if (operation.action === "update") { // 缩放后仅更新局部 https://github.com/siyuan-note/siyuan/issues/14326 if (updateElements.length === 0) { - const newUpdateElement = protyle.wysiwyg.element.querySelector('[data-node-id]'); + const newUpdateElement = protyle.wysiwyg.element.querySelector("[data-node-id]"); const newUpdateId = newUpdateElement.getAttribute("data-node-id"); const tempElement = document.createElement("template"); tempElement.innerHTML = operation.data;