From d3742f07709b54d7fb2731e66c967b7a1ad1d4fd Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 24 Nov 2023 20:58:31 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20https://github.com/siyuan-note/siyuan/i?= =?UTF-8?q?ssues/9727=20=E8=BD=AC=E4=B9=89=E7=AC=A6dom=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/wysiwyg/input.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 068f7f2c5..9f11857ea 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -145,8 +145,13 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: if (blockElement.classList.contains("table")) { scrollLeft = getContenteditableElement(blockElement).scrollLeft; } - // 使用 md 闭合后继续输入应为普通文本 - blockElement.outerHTML = html.replace("", "" + Constants.ZWSP + ""); + if (/.<\/span>/.test(html)) { + // 转义不需要添加 zwsp + blockElement.outerHTML = html; + } else { + // 使用 md 闭合后继续输入应为普通文本 + blockElement.outerHTML = html.replace("", "" + Constants.ZWSP + ""); + } protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`).forEach((item: HTMLElement) => { if (item.getAttribute("data-type") === "NodeBlockQueryEmbed" || !hasClosestByAttribute(item, "data-type", "NodeBlockQueryEmbed")) {