redbug312 / markdown-it-multimd-table

Multimarkdown table syntax plugin for markdown-it markdown parser
MIT License
144 stars 37 forks source link

Unable to properly handle "Grave Accent" in inline code. #56

Closed LightAPIs closed 1 year ago

LightAPIs commented 1 year ago

The rendered table is incorrect when the "grave accent" symbol is included in the inline code.

Example

Markdown table content

| Code | Des |
| --- | --- |
| `` grave(`) `` | des |
| `` grave(\`) `` | des |

JavaScript code

// test.cjs
const markdown = require('markdown-it');
const multimd = require('markdown-it-multimd-table');

const md = markdown().use(multimd);

const exampleTable = '| Code | Des |\n' + '| --- | --- |\n' + '| `` grave(`) `` | des |\n' + '| `` grave(\\`) `` | des |';
console.log(md.render(exampleTable));

Output

<table>
<thead>
<tr>
<th>Code</th>
<th>Des</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>grave(`)</code> | des |</td>
</tr>
<tr>
<td><code>grave(\`)</code></td>
<td>des</td>
</tr>
</tbody>
</table>

joplin

Expected rendering result

markdown-it