From 292c195e9b7c186edc176887e53701e2e133c9fe Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 13 Jan 2023 15:25:58 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/7066 --- app/src/protyle/wysiwyg/remove.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index 2317bbffc..58ff479c7 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -448,7 +448,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran // 非空块 range.setEndAfter(editableElement.lastChild); // 数学公式会车后再删除 https://github.com/siyuan-note/siyuan/issues/3850 - if (previousLastEditElement?.lastElementChild?.getAttribute("data-type").indexOf("inline-math") > -1) { + if ((previousLastEditElement?.lastElementChild?.getAttribute("data-type") || "").indexOf("inline-math") > -1) { const lastSibling = hasNextSibling(previousLastEditElement?.lastElementChild); if (lastSibling && lastSibling.textContent === "\n") { lastSibling.remove();