Reputation: 33505
For a table cell in Github markdown, you have to escape |
with \
to avoid having it interpreted as the next cell. Once you escape it, everything is fine e.g. https://github.com/russellw/clause-normal-form the entries for Nor and Or.
For a table cell in npm markdown, this doesn't work; the \
comes out in the display e.g. https://www.npmjs.com/package/clause-normal-form the entries for Nor and Or.
How to escape |
in a table in a readme, such that Github and npm will both display it correctly?
Upvotes: 1
Views: 263
Reputation: 111466
<code>| | | | |</code>
The above is rendered as: | | | | |
You should be able to use HTML entities in Markdown and <code></code>
instead of backticks will avoid auto-escaping of &
as &
inside. Of course you may have some other characters that need escaping depending on your particular example.
For more entities see: https://dev.w3.org/html5/html-author/charref
Remember that you can use HTML (including HTML entities) in Markdown:
For any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags.
See: https://daringfireball.net/projects/markdown/syntax#html
Upvotes: 2