Skip to content

Commit

Permalink
Fix escaping of | inside table cells
Browse files Browse the repository at this point in the history
`|` is a special character inside tables and need to be escaped
if used inside table cells.

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
  • Loading branch information
susnux committed Oct 3, 2022
1 parent 6111e80 commit 9b3ddae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nodes/Table/TableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export default TableCell.extend({

toMarkdown(state, node) {
state.write(' ')
const backup = state.options?.escapeExtraCharacters
state.options.escapeExtraCharacters = /\|/
state.renderInline(node)
state.options.escapeExtraCharacters = backup
state.write(' |')
},

Expand Down

0 comments on commit 9b3ddae

Please sign in to comment.