Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/10653

Vanessa521c7289b83e
diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts
index dc0b91099d..274493374e 100644
--- a/app/src/protyle/wysiwyg/enter.ts
+++ b/app/src/protyle/wysiwyg/enter.ts
@@ -219,7 +219,9 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
// 回车之前的块为 1\n\n2 时会产生多个块
Array.from(enterElement.children).forEach((item: HTMLElement) => {
if (item.dataset.nodeId === id) {
- editableElement.innerHTML = item.querySelector('[contenteditable="true"]').innerHTML;
+ const previousElement = blockElement.previousElementSibling;
+ blockElement.outerHTML = item.outerHTML;
+ blockElement = (previousElement?.nextElementSibling || protyle.wysiwyg.element.firstElementChild) as HTMLElement;
doOperation.push({
action: "update",
data: blockElement.outerHTML,