Escaped Pipes (in tables) retain escape character (\)
See original GitHub issueSubject of the issue
When using Markdown Table syntax, using the escape character () for pipes (|) does not remove the escape character when rendered. Example:
This is not a place to ask questions. For that, go to Spectrum
Your environment
- OS: MacOS 10.14
- Packages: mdx-js 1.5.1
- Env: Chrome 79, Node 12.11
Steps to reproduce
Tried to create an mvce on CodeSandbox but that was met with frustration. Basically, create a simple component with a Markdown table and attempt to use an escaped pipe in that table:
# Hello, world!
<Button>Here is a button</Button>
|Test|Test2|
|---|---|
|`testy \| testy` | testy |
Expected behaviour
The pipe should be rendered without the preceding escape character
Actual behaviour
The pipe is rendered prepended by the escape character.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to Escape the Pipe Character in a Markdown Table?
#Escaping the Pipe Character. In some platforms you can directly escape the pipe character in markdown using a backslash like so:
Read more >Pipe Character Escape for Gherkin Tables - Automation Panda
If you ever want to write a Gherkin table with "|" in the text, simply escape it with a backslash like so: "\|"....
Read more >How to escape a pipe char in a code statement in a markdown ...
The problem is that the vertical bar in the code statement of the second line is interpreted as a column delimiter. Then the...
Read more >Pipe character is not properly escaped in table - Obsidian Forum
I've escape the pipe that is inside the code block because I am in a table. Actual result. Result in obsidian:.
Read more >Extended Syntax - Markdown Guide
Escaping Pipe Characters in Tables. You can display a pipe ( | ) character in a table by using its HTML character code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Docusaurus should update to MDX 2, there is already an issue open about it.
Then the behavior of MDX, with
remark-gfm
(which defines tables), matches exactly how GH handles tables.This indeed has to do with how remark-parse interprets table cells and is a bug there. The escape slash is a literal slash, instead of an escape. We’re working on a replacement that has much better support for MDX.
If you’d like to support us to get there faster, and are able to, please sponsor us on OpenCollective!