diff --git a/app/src/block/util.ts b/app/src/block/util.ts index bc0971145..495d20fd3 100644 --- a/app/src/block/util.ts +++ b/app/src/block/util.ts @@ -50,11 +50,7 @@ export const cancelSB = async (protyle: IProtyle, nodeElement: Element, range?: getContenteditableElement(nodeElement).insertAdjacentHTML("afterbegin", ""); } nodeElement.lastElementChild.remove(); - // 超级块中的 html 块需要反转义再赋值 https://github.com/siyuan-note/siyuan/issues/13155 - nodeElement.querySelectorAll("protyle-html").forEach(item => { - item.setAttribute("data-content", item.getAttribute("data-content").replace(/</g, "<").replace(/>/g, ">")); - }); - nodeElement.outerHTML = nodeElement.innerHTML; + nodeElement.replaceWith(nodeElement.firstElementChild); if (range) { focusByWbr(protyle.wysiwyg.element, range); } diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index db351ffee..683b46554 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -305,17 +305,24 @@ const dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElemen doOperations.push(...moveToResult.doOperations); undoOperations.push(...moveToResult.undoOperations); const newSourceParentElement = moveToResult.newSourceElements; + let removeIndex = doOperations.length - 1; + doOperations.find((item, index) => { + if (item.action === "delete" && item.id === targetMoveUndo.parentID) { + removeIndex = index; + return true; + } + }); if (isBottom) { // 拖拽到超级块 col 下方, 其他块右侧 sbElement.insertAdjacentElement("afterbegin", targetElement); - doOperations.push({ + doOperations.splice(removeIndex, 0, { action: "move", id: targetElement.getAttribute("data-node-id"), parentID: sbElement.getAttribute("data-node-id") }); } else { sbElement.lastElementChild.insertAdjacentElement("beforebegin", targetElement); - doOperations.push({ + doOperations.splice(removeIndex, 0, { action: "move", id: targetElement.getAttribute("data-node-id"), previousID: newSourceParentElement[0].getAttribute("data-node-id"),