From 6bef049f358e42fa3ba98b58f6a4f2cf9db94f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 13 Aug 2024 19:05:46 +0200 Subject: [PATCH] fix: Ignore plaintext language in mardown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/nodes/CodeBlock.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nodes/CodeBlock.js b/src/nodes/CodeBlock.js index fb79ad008de..9df486e47b8 100644 --- a/src/nodes/CodeBlock.js +++ b/src/nodes/CodeBlock.js @@ -38,7 +38,8 @@ const CodeBlock = TiptapCodeBlockLowlight.extend({ const backticks = node.textContent.match(/`{3,}/gm) const fence = backticks ? (backticks.sort().slice(-1)[0] + '`') : '```' - state.write(fence + (node.attrs.params || '') + '\n') + const language = node.attrs.params !== 'plaintext' ? node.attrs.params : '' + state.write(fence + (language || '') + '\n') state.text(node.textContent, false) // Add a newline to the current content before adding closing marker state.ensureNewLine()