Skip to content

Commit

Permalink
fix: Ignore plaintext language in mardown
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Aug 13, 2024
1 parent 2ef0814 commit 6bef049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nodes/CodeBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6bef049

Please sign in to comment.