From f8412a49c42a146d00d979592bb1746cf81c4f60 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 14 May 2023 10:27:16 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/8187 --- app/src/protyle/wysiwyg/input.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts index 6ebec9717..fcc5a24b7 100644 --- a/app/src/protyle/wysiwyg/input.ts +++ b/app/src/protyle/wysiwyg/input.ts @@ -50,7 +50,7 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: return; } if (turnIntoTaskList(protyle, type, blockElement, editElement, range)) { - return; + return; } if (headingTurnIntoList(protyle, type, blockElement, editElement, range)) { return; @@ -101,8 +101,10 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range: html += genEmptyBlock(false, true); } } else { - if (trimStartText.startsWith("```") || trimStartText.startsWith("~~~") || trimStartText.startsWith("···") || - trimStartText.indexOf("\n```") > -1 || trimStartText.indexOf("\n~~~") > -1 || trimStartText.indexOf("\n···") > -1) { + if (type !== "NodeCodeBlock" && ( + trimStartText.startsWith("```") || trimStartText.startsWith("~~~") || trimStartText.startsWith("···") || + trimStartText.indexOf("\n```") > -1 || trimStartText.indexOf("\n~~~") > -1 || trimStartText.indexOf("\n···") > -1 + )) { if (trimStartText.indexOf("\n") === -1 && trimStartText.replace(/·|~/g, "`").replace(/^`{3,}/g, "").indexOf("`") > -1) { // ```test` 不处理,正常渲染为段落块 } else {