Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/12703

Vanessa9199520f0309
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 260c06e25f..c590e93f36 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -347,6 +347,9 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
if (operation.action === "unfoldHeading") {
const scrollTop = protyle.contentElement.scrollTop;
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
+ if (isInEmbedBlock(item)) {
+ return;
+ }
if (operation.retData) { // undo 的时候没有 retData
removeUnfoldRepeatBlock(operation.retData, protyle);
item.insertAdjacentHTML("afterend", operation.retData);
@@ -1178,6 +1181,9 @@ const processFold = (operation: IOperation, protyle: IProtyle) => {
if (operation.action === "unfoldHeading") {
const scrollTop = protyle.contentElement.scrollTop;
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
+ if (isInEmbedBlock(item)) {
+ return;
+ }
if (!item.lastElementChild.classList.contains("protyle-attr")) {
item.lastElementChild.remove();
}