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
Backslashes appear in output when escaping inline code in a table cell #583
Comments
|
Thanks PJ for this detailed issue! I read a lot of issues daily where folks remove lots of the issue template and this is great to see! If I add Do you think this interpretation of the issue is correct? |
|
Well, that's certainly a bug. But, as you correctly point out, remark-parse 13 does not have this problem, so that's the version Obsidian needs to upgrade to. It appears that my unfamiliarity with remark made it look like a variation of the problem still existed in 13, but is actually a completely different problem. So, the tl;dr is that the problem I wanted to report is actually fixed in remark-parse 13, but my test case exposes a completely different issue with mdast-util-to-markdown. |
|
Thanks, released! |
Subject of the issue
When using inline code in a table cell, it's necessary to backslash-escape pipe characters. On Github, the backslashes are removed before parsing the table cell contents, so that they aren't included in the output. Remark doesn't do this, so there is no way to put a pipe character inside inline code in a table cell without at least one spurious backslash being passed through to the output.
(Note that this is not the same issue as #465, which is about what happens if you don't escape the pipe character.)
Your environment
Steps to reproduce
Process this markdown with the remark-gfm extension:
| Ways of Reading Stdout | Linux | OS X (bash 3.2) | Windows | | ------------------------------ | --------: | --------------: | -------: | | `[[ ${spork-} ]] \|\| spork ...` | 40433/s | 33840/s | 17667/s | | Total Performance Improvement | 34.1x | 24.7x | 271.8x |Expected behavior
The markdown should be parsed as on Github, dropping the backslashes from the inline code, i.e:
[[ ${spork-} ]] || spork ...Actual behavior
When parsed with remark 9, neither backslash is removed. When parsed with remark 13, the second and all subsequent backslashed pipe characters in the cell are correctly removed, but the first backslash is passed through unchanged.
The text was updated successfully, but these errors were encountered: