erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.69k stars 1.12k forks source link

backtick escaping inside a table seems to break the table #746

Open hartman opened 5 years ago

hartman commented 5 years ago

Take the following markdown

| Formatting         | Symbol                   | Example                              |
| ------------------ | ------------------------ | ------------------------------------ |
| `Code`             | Three backticks \`\`\` | \`\`\`print 'Hello World';\`\`\`     |

In the first cell I want inline code markup, in the second cell, i want three escaped backticks, and in the third i want a pair of three escaped markdowns. As can be seen in the screenshot, made using https://parsedown.org/extra/ this breaks the table..

Screenshot 2019-07-11 at 14 03 51

I couldn't find a way around it either.

Oh the irony of documenting a markdown flavour and finding an issue in a markdown parser which you then have to report using markdown escaped inside markdown ;)

taufik-nurrohman commented 5 years ago

Wrap in <code> tags:

| `Code` | Three backticks ` ``` ` | ` ```print 'Hello World';``` ` |
hartman commented 5 years ago

but then i have code formatting highlighting that content, which isn't desirable. ;)

taufik-nurrohman commented 4 years ago

Use HTML entities:

| `Code` | Three backticks &#96;&#96;&#96; | &#96;&#96;&#96;print 'Hello World';&#96;&#96;&#96; |