diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 21105e8c9..8ec43da4a 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -37,6 +37,10 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: } else if (type === "NodeBlockQueryEmbed") { blockElement.lastElementChild.previousElementSibling.innerHTML = "" + Constants.ZWSP; } else if (type === "NodeMathBlock" || type === "NodeHTMLBlock") { + // https://github.com/siyuan-note/siyuan/issues/15761 + if (blockElement.firstElementChild.firstChild.nodeType === 3) { + blockElement.firstElementChild.firstChild.remove(); + } blockElement.lastElementChild.previousElementSibling.lastElementChild.innerHTML = "" + Constants.ZWSP; } else if (type === "NodeIFrame" || type === "NodeWidget") { blockElement.innerHTML = "" + blockElement.firstElementChild.outerHTML + blockElement.lastElementChild.outerHTML;