vsch / flexmark-java

CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
BSD 2-Clause "Simplified" License
2.21k stars 260 forks source link

Incorrect HTML generated for escaped pipe inside a table cell #604

Open kwin opened 6 months ago

kwin commented 6 months ago

Describe the bug

For the markdown leveraging GFM table extension as outlined in https://github.github.com/gfm/#example-200. the escaped pipe is not unescaped correctly.

To Reproduce

Just parse https://github.github.com/gfm/#example-200 and convert to HTML. What is emitted is

<table>
<thead>
<tr>
<th>f|oo</th>
</tr>
</thead>
<tbody>
<tr>
<td>b <code>\|</code> az</td>
</tr>
<tr>
<td>b <strong>|</strong> im</td>
</tr>
</tbody>
</table>

instead of

<table>
<thead>
<tr>
<th>f|oo</th>
</tr>
</thead>
<tbody>
<tr>
<td>b <code>|</code> az</td>
</tr>
<tr>
<td>b <strong>|</strong> im</td>
</tr>
</tbody>
</table>

The escaped pipe character \| inside the code style is not properly unescaped.

This happens with flexmark 0.62.2