Problem rendering pipe characters in code blocks within tables
See original GitHub issueHello, thank you heartily for this great library. It took me quite few months to encounter a bug, which I am reporting here.
Mistletoe seems unable to render pipe characters in code blocks within tables. Here is an example of observed behavior:
mistletoe [version 0.7.2] (interactive)
Type Ctrl-D to complete input, or Ctrl-C to exit.
>>> | Table | Header |
... |--- |--- |
... | `<|>` | `<|>` |
...
... ^Z
<table>
<thead>
<tr>
<th align="left">Table</th>
<th align="left">Header</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">`<</td>
<td align="left">>`</td>
<td align="left">`<</td>
<td align="left">>`</td>
</tr>
</tbody>
</table>
>>>
The following was my expected rendering:
Table | Header |
---|---|
<|> |
<|> |
Interestingly, this behavior can not be expected in GFM, which requires escapes for pipes: https://github.com/github/markup/issues/1078
However, escaping pipes is not working in mistletoe:
>>> | Table | Header |
... |--- |--- |
... |`<\|>` | `<\|>` |
... ^Z
<table>
<thead>
<tr>
<th align="left">Table</th>
<th align="left">Header</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">`<\</td>
<td align="left">>`</td>
<td align="left">`<\</td>
<td align="left">>`</td>
</tr>
</tbody>
</table>
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Markdown: Incorrect rendering of pipe in code block ... - GitHub
It looks like GitHub's markdown parser gets confused by the presence of a pipe ( | ) in a code block within a...
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 >1 Code::Blocks Project Management
The Code::Blocks Management window offers a tree view for symbols of C/C++ sources for navigating via functions or variables. As the scope of...
Read more >Markdown syntax for files, widgets, and wikis - Azure DevOps
Learn how to share information, add tables & mathematical notation using Markdown within pull requests, README files, dashboards, and wikis.
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 Free
Top 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
OK, thank you for your feedback, I think I will look at this next week then.
Yes, I was given write permissions by @miyuchina who seems to like my contributions, so hopefully I can bring the library a little bit further, even though it may have lost some users in the previous years. I take it as a challenge. 😃
No problem, thank you. 👍