From 8b5c27f05487903686812632b3662b06d038f418 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 9 Apr 2024 08:22:21 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/10941 --- app/src/protyle/toolbar/InlineMath.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/InlineMath.ts b/app/src/protyle/toolbar/InlineMath.ts index 80b622489..5a8202b9a 100644 --- a/app/src/protyle/toolbar/InlineMath.ts +++ b/app/src/protyle/toolbar/InlineMath.ts @@ -19,7 +19,7 @@ export class InlineMath extends ToolbarItem { let mathElement = hasClosestByAttribute(range.startContainer, "data-type", "inline-math") as Element; if (!mathElement && range.startContainer.nodeType !== 3 && range.startContainer.childNodes[range.startOffset]) { const previousSibling = hasPreviousSibling(range.startContainer.childNodes[range.startOffset]) as HTMLElement; - if (previousSibling && previousSibling.getAttribute("data-type").indexOf("inline-math") > -1) { + if (previousSibling && previousSibling.nodeType !==3 && previousSibling.getAttribute("data-type").indexOf("inline-math") > -1) { mathElement = previousSibling; } }