I'm trying to write article about Markdown syntax, and to write it, I use Markdown.
So, my document looks like this:
Example of markdown code:
```
foo
```
fenced code block (fail)
```
bar
```
lalala...
And this breaks the parser. Screenshot taked from Commonmark dingus, but is also rendered in some another parsers I tried, namely Showdown and MultiMarkdown.
(Maybe such issues fixed in non-javascript parsers, like Kramdown? I doesn't tested)
How it may be fixed?
I couldn't find it documented but you can increase the amount of backticks in commonmark.js dingus and GitHub Flavored Markdown. Your example could be fixed like this:
Example of markdown code:
`````
foo
```
fenced code block (fail)
```
bar
`````
lalala...
Be aware that it might not work on other parsers (like Showdown). However, some parsers do not support fanced code at all. Another possibility is to not use fenced code. You could write
Example of markdown code:
foo
```
fenced code block (fail)
```
bar
lalala...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With