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/17800

Vanessae26c4a844c34
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 2f0c2024c7..d1a0e169a7 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -1177,6 +1177,7 @@ export const turnsIntoTransaction = (options: {
} else {
previousId = undefined;
}
+ item.outerHTML = newHTML;
} else {
let foldData;
if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1" &&
@@ -1187,7 +1188,6 @@ export const turnsIntoTransaction = (options: {
if (foldData && foldData.doOperations?.length > 0) {
doOperations.push(...foldData.doOperations);
}
- item.setAttribute(Constants.ATTRIBUTE_EDITING, "true");
undoOperations.push({
action: "update",
id,
@@ -1201,8 +1201,11 @@ export const turnsIntoTransaction = (options: {
if (foldData && foldData.undoOperations?.length > 0) {
undoOperations.push(...foldData.undoOperations);
}
+ item.insertAdjacentHTML("afterend", newHTML);
+ item = item.nextElementSibling as HTMLElement;
+ item.previousElementSibling.remove();
+ item.setAttribute(Constants.ATTRIBUTE_EDITING, "true");
}
- item.outerHTML = newHTML;
} else {
undoOperations.push({
action: "insert",