Skip to content

Commit

Permalink
Correct comment/note on when pipe characters are/not escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskrycho authored and Byron committed Nov 22, 2024
1 parent 13785fe commit c9ecdd2
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,13 @@ where
}

// (re)-escape `|` when it appears as part of inline code in the
// body of a table. NOTES:
// - This is always *safe*, but may not be *necessary*: more recent
// versions of `pulldown-cmark` do not require this because they
// correctly handle unescaped pipes in this position.
// - This does not do *general* escaped-character handling because
// the only character which *requires* this handling in this spot
// in earlier versions of `pulldown-cmark` is a pipe character in
// inline code in a table. Other escaping is handled when `Text`
// events are emitted.
// body of a table.
//
// NOTE: This does not do *general* escaped-character handling
// because the only character which *requires* this handling in this
// spot in earlier versions of `pulldown-cmark` is a pipe character
// in inline code in a table. Other escaping is handled when `Text`
// events are emitted.
let text = if state.in_table_cell {
text.replace('|', "\\|")
} else {
Expand Down

0 comments on commit c9ecdd2

Please sign in to comment.