question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escaped Pipes (in tables) retain escape character (\)

See original GitHub issue

Subject of the issue

When using Markdown Table syntax, using the escape character () for pipes (|) does not remove the escape character when rendered. Example: image

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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wooormcommented, Apr 7, 2022

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.

1reaction
wooormcommented, Nov 6, 2019

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found