This commit is contained in:
Vanessa 2022-09-30 10:54:54 +08:00
parent 673114dac6
commit f2b2079972

View file

@ -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");