Closed huettenhain closed 3 years ago
@huettenhain, thanks for the report. It looks like the GFM's approach seems to be even somewhat in-line with the CommonMark specification (https://spec.commonmark.org/0.30/#precedence). So I would go their way, i. e. to enable to escape |
whenever it is inside a cell. I cannot quite imagine any other solution. That will mean the following changes in the code:
What do you think? It would be great to have some feedback before starting with the implementation.
That seems perfectly reasonable to me, and I should add that I am very happy and grateful to see this nice library brought to life again.
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. :)
Just looking at this. I have some interesting findings:
|
).So no change in the direction of this issue actually. I'm only re-classifying it: it is probably not a bug, but rather an enhancement.
Another finding: It looks like even GitHub is not handling this edge case:
|a|b|
|-|-|
|ending with slash: \\|other cell|
This results in just one cell in the row:
a | b |
---|---|
ending with slash: \|other cell |
Of course, users will hopefully never do something like that. So I wouldn't implement handling of this edge case now. It would probably require using something more complicated than a simple row-string split (which just checks for any \
not being present right in front of splitting |
, because a more precise regex look-behind cannot be used).
@huettenhain, so I prepared the implementation in a dedicated branch. Can you please check it out, together with my notes above?
close: I merged the branch, enjoy and feel free to reopen in case of any problems.
Ah, I am so sorry, I just couldn't get to this. I think this is a good way to proceed, I will let you know if any problems arise.
No problem, thank you. 👍
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:
The following was my expected rendering:
<\|>
<\|>
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: