From 7dbc5465bdf33dec7510d29438b5ab846cdd1a92 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 29 Jun 2024 11:10:56 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/11851 --- app/src/protyle/wysiwyg/input.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 29947a70efc..349d4bd3b56 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -64,7 +64,8 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: } } const id = blockElement.getAttribute("data-node-id"); - if (type !== "NodeCodeBlock" && (editElement.innerHTML.endsWith("\n") || editElement.innerHTML.endsWith("\n\n"))) { + if ((type !== "NodeCodeBlock" && type !== "NodeHeading") && // https://github.com/siyuan-note/siyuan/issues/11851 + (editElement.innerHTML.endsWith("\n") || editElement.innerHTML.endsWith("\n\n"))) { // 软换行 updateTransaction(protyle, id, blockElement.outerHTML, protyle.wysiwyg.lastHTMLs[id] || blockElement.outerHTML.replace("\n", "")); wbrElement.remove();