Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Ignore plaintext language in mardown
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Aug 14, 2024
commit 7d0a6d1aecb7077285888079d228fbf19e2a0118
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