In a table in Markdown, a pipe character (|
) is used to separate columns in a table.
However, it's also a pretty common character in code, especially as the bitwise OR operator.
When writing inline code blocks in a Markdown table, how should the pipe be escaped, if at all?
There are two candidate methods for writing a pipe in a literal.
This is accepted and rendered correctly by Pandoc and StackOverflow, but not by GitHub:
| My Table! |
| ------------------ |
| behold, a pipe: `|`|
This is accepted and rendered correctly by GitHub, but not by Pandoc or StackOverflow:
| My Table! |
| ------------------- |
| behold, a pipe: `\|`|
It seems to be unclear as to whether the pipe needs to be escaped. Does the Markdown specification describe whether the pipe must be escaped?