From 407eb53ea1ca359c9425e54e51a07115389026e7 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 31 Mar 2025 22:47:25 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14481 --- app/src/protyle/wysiwyg/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index f153119c8..9c87a90b7 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2641,6 +2641,13 @@ export class WYSIWYG { if (attrElement) { newRange = setLastNodeRange(attrElement.previousElementSibling, newRange, false); } + // https://github.com/siyuan-note/siyuan/issues/14481 + const inlineMathElement = hasClosestByAttribute(newRange.startContainer, "data-type", "inline-math"); + if (inlineMathElement) { + newRange.setEndAfter(inlineMathElement); + newRange.collapse(false); + focusByRange(newRange); + } /// #if !MOBILE if (newRange.toString().replace(Constants.ZWSP, "") !== "") { protyle.toolbar.render(protyle, newRange);