Vanessa 2023-10-04 21:02:49 +08:00
parent 29712f6f77
commit 61ee5676c4
10 changed files with 76 additions and 44 deletions

View file

@ -154,7 +154,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
if (editWbrElement && editableElement && !trimStartText.endsWith("\n")) {
// 数学公式后无换行,后期渲染后添加导致 rang 错误,中文输入错误 https://github.com/siyuan-note/siyuan/issues/9054
const previousElement = hasPreviousSibling(editWbrElement) as HTMLElement;
if (previousElement && previousElement.nodeType !== 3 && previousElement.dataset.type.indexOf("inline-math") > -1 &&
if (previousElement && previousElement.nodeType !== 3 && (previousElement.dataset.type || "").indexOf("inline-math") > -1 &&
!hasNextSibling(editWbrElement)) {
editWbrElement.insertAdjacentText("afterend", "\n");
}