From de3373b8b90ea5af2ba89a260e65829dae586e16 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 15 Sep 2024 17:29:39 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12448 --- app/src/protyle/wysiwyg/transaction.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index a31ea1473..260c06e25 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -646,6 +646,18 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: cursorElements.push(item.nextElementSibling); } }); + } else if (operation.nextID) { + Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.nextID}"]`)).forEach(item => { + const embedElement = isInEmbedBlock(item); + if (embedElement) { + // https://github.com/siyuan-note/siyuan/issues/5524 + embedElement.removeAttribute("data-render"); + blockRender(protyle, embedElement); + } else { + item.insertAdjacentHTML("beforebegin", operation.data); + cursorElements.push(item.previousElementSibling); + } + }); } else { if (!protyle.options.backlinkData && operation.parentID === protyle.block.parentID) { protyle.wysiwyg.element.insertAdjacentHTML("afterbegin", operation.data);