From bb1a4b4119a5227d9c90e4737e9873d8b4fd5ebb Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 17 Mar 2025 22:56:41 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14370 --- app/src/protyle/wysiwyg/transaction.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index c64fc9232..9c35d23bf 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -263,6 +263,7 @@ 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}"]`)) if (updateEmbedElements.length === 0) { const tempElement = document.createElement("template"); @@ -272,14 +273,14 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => { const newTempElement = tempElement.content.querySelector(`[data-node-id="${embedBlockItem.getAttribute("data-id")}"]`) if (newTempElement) { updateEmbedElements.push(embedBlockItem.firstElementChild) - operation.data = newTempElement.outerHTML + html = newTempElement.outerHTML } }); }); } updateEmbedElements.forEach((item) => { const tempElement = document.createElement("div"); - tempElement.innerHTML = operation.data; + tempElement.innerHTML = html; tempElement.querySelectorAll('[contenteditable="true"]').forEach(editItem => { editItem.setAttribute("contenteditable", "false"); });