-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escaped Pipes (in tables) retain escape character (\) #838
Comments
To be fair, I think this bug may lie more in how unified.js handles escaped pipes, but I admittedly don't have enough experience with unified (or ASTs in general) to know. |
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! |
Sorry btw, forgot about this issue, but this is, horrible as that may sound, a feature instead of a bug. Escapes ( It’s what lets you embed HTML and other things inside code blocks without needing to double encode everything such as |
Hi @wooorm Even though this issue is a few years old, our team still has the same issue today. It's true that In our product documentation, we specify a lot of shell code with pipe characters and would like our customers to be able to easily copy and paste commands from code blocks. As we move our documentation to Docusaurus which uses MDX, this problem arises. Our current workaround is to use the HTML <code> tag, but that's not native markdown and makes our documentation markdown messy. Do you have any new information on this please? |
Docusaurus should update to MDX 2, there is already an issue open about it. Then the behavior of MDX, with |
Subject 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
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:
Expected behaviour
The pipe should be rendered without the preceding escape character
Actual behaviour
The pipe is rendered prepended by the escape character.
The text was updated successfully, but these errors were encountered: