Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/16292

Vanessabaa003027b06
diff --git a/app/src/block/util.ts b/app/src/block/util.ts
index bc09711450..495d20fd3a 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", "<wbr>");
}
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(/&lt;/g, "<").replace(/&gt;/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 db351ffeec..683b465546 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"),