From 91667b175a83ac5a299fafd0c2de6046b5b1a3d4 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 16 Aug 2023 22:58:49 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/8972 --- app/src/protyle/wysiwyg/input.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 533805ea2..766267eed 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -148,12 +148,17 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: // 使用 md 闭合后继续输入应为普通文本 blockElement.outerHTML = html.replace("", "" + Constants.ZWSP + ""); } + // https://github.com/siyuan-note/siyuan/issues/8972 + const mathSize = blockElement.querySelectorAll('[data-type="inline-math"]').length; protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`).forEach((item: HTMLElement) => { if (item.getAttribute("data-type") === "NodeBlockQueryEmbed" || !hasClosestByAttribute(item, "data-type", "NodeBlockQueryEmbed")) { blockElement = item; } }); + if (mathSize > 0 && mathSize < html.split(' { const tempId = item.getAttribute("data-node-id"); let realElement;