Indented fenced code blocks containing blank lines do not render properly.
When a fenced code block is indented (because it is part of a bulleted list, for example), it will not render correctly if it contains one or more blank lines.
The following Markdown shows the problem:
~~~
Unindented fenced blocks work fine with blank lines, like the following:
This block renders without problems.
~~~
* First paragraph of a bullet point.
~~~
Indented fenced blocks break if they contain blank lines, like this one:
See? This block was not correctly rendered.
~~~
Another paragraph of a bullet point.
The second fenced block renders fine if the blank line is removed.
Thanks, I'll check it out...
Thank you, much appreciated.
While trying to work around this issue, I noticed that a similar thing happens if I try to have an indented block HTML element (e.g. <pre><code>...</code></pre>) in a bullet list. This works, but again, only if there is no blank line within the block.
Now, strictly speaking, indented block HTML in a bullet list isn’t valid Markdown (Gruber: ‘the start and end tags of the [HTML] block should not be indented with tabs or spaces’), but since indented blocks almost work in pegdown, and since they are useful, it would be nice if pegdown fully supported them.
As a work-around for my content, I have reverted to using HTML ul/ol elements (rather than Markdown syntax) for bullet lists that contain list items with embedded code blocks.