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.

Problem rendering pipe characters in code blocks within tables

See original GitHub issue

Hello, 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">`&lt;</td>
<td align="left">&gt;`</td>
<td align="left">`&lt;</td>
<td align="left">&gt;`</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">`&lt;\</td>
<td align="left">&gt;`</td>
<td align="left">`&lt;\</td>
<td align="left">&gt;`</td>
</tr>
</tbody>
</table>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pbodnarcommented, Sep 26, 2021

That seems perfectly reasonable to me,

OK, thank you for your feedback, I think I will look at this next week then.

I should add that I am very happy and grateful to see this nice library brought to life again.

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. 😃

0reactions
pbodnarcommented, Oct 9, 2021

No problem, thank you. 👍

Read more comments on GitHub >

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

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