Closed ahmedelgabri closed 2 years ago
Tables are a GFM feature, not part of CommonMark. GFM is not supported by remark by default. This should work when you use remark-gfm
@wooorm thanks this fixes the issue, but I wonder if the current behavior is wrong still. Shouldn't remark return the input as is? Because theoretically in my case I don't even need remark-gfm
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
As "normal" markdown doesn't use pipes for any special meaning, it's superfluous, and superfluous things are dropped
While GFM is common, "normal" markdown is also common. Similar to, say, escaped dollars. They could perhaps mean something when a math extension is used. But we'd need to know about that.
Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.
See our support docs for how and where to ask questions.
Thanks, — bb
Thanks @wooorm & enjoy your weekend & Happy Holidays :)
Thanks Ahmed, you too, and stay safe :)
Initial checklist
Affected packages and versions
remark 14.0.2
Link to runnable example
https://codesandbox.io/s/red-dream-iqwrh?file=/src/index.js
Also, a repo is here https://github.com/ahmedelgabri/remark-issue
Steps to reproduce
foo.md
remark
without any plugins. this is the script that I'm usingExpected behavior
The table is returned as-is
Commonmark also renders this properly https://spec.commonmark.org/dingus/?text=%7C%20Name%20%7C%20Type%20%7C%0A%7C%20%3A------%20%7C%20%3A------%20%7C%0A%7C%20%60foo%60%20%7C%20%60string%60%20%5C%7C%20%60string%5B%5D%60%20%7C
Actual behavior
Notice that the escaped pipe is not escaped anymore & instead the opening square bracket is escaped.
And if you later format this with prettier it will lead to this.
Runtime
Node v16
Package manager
yarn v1
OS
macOS
Build and bundle tools
Other (please specify in steps to reproduce)