From 81e5bdc32a083d7c881282a44273f7b3fd775df1 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 9 Dec 2022 17:39:00 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/6829 --- app/src/protyle/wysiwyg/remove.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index 72f75b801..2317bbffc 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -215,9 +215,13 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran } } } else { + let data = topElement.outerHTML; // 不能 spin ,否则 li 会变为 list + if (topElement.classList.contains("render-node") || topElement.querySelector("div.render-node")) { + data = protyle.lute.SpinBlockDOM(topElement.outerHTML); // 防止图表撤销问题 + } inserts.push({ action: "insert", - data: protyle.lute.SpinBlockDOM(topElement.outerHTML), // 防止图标撤销问题 + data, id, previousID: topElement.previousElementSibling ? topElement.previousElementSibling.getAttribute("data-node-id") : "", parentID: topElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID