Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/6018

Vanessaf2b2079972b1
diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts
index b28a0f5fcc..6a1e50c073 100644
--- a/app/src/protyle/wysiwyg/enter.ts
+++ b/app/src/protyle/wysiwyg/enter.ts
@@ -151,6 +151,7 @@ const listEnter = (protyle: IProtyle, blockElement: HTMLElement, range: Range) =
selectNode.firstChild.remove();
}
// https://github.com/siyuan-note/siyuan/issues/3850
+ // https://github.com/siyuan-note/siyuan/issues/6018
if ((editableElement?.lastElementChild?.getAttribute("data-type") || "").indexOf("inline-math") > -1 &&
!hasNextSibling(editableElement?.lastElementChild)) {
editableElement.insertAdjacentText("beforeend", "\n");
@@ -363,6 +364,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
selectNode.firstChild.remove();
}
// https://github.com/siyuan-note/siyuan/issues/3850
+ // https://github.com/siyuan-note/siyuan/issues/6018
if ((editableElement?.lastElementChild?.getAttribute("data-type") || "").indexOf("inline-math") > -1 &&
!hasNextSibling(editableElement?.lastElementChild)) {
editableElement.insertAdjacentText("beforeend", "\n");