If I have the following text
---------------------------------------------------
Just a small test
This is some code
and some indented code
and this is the end
1. Just a small test
This is some code
and some indented code
and this is the end
---------------------------------------------------
This results in
---------------------------------------------------
<p>Just a small test</p>
<pre><code>This is some code
and some indented code
</code></pre>
<p>and this is the end</p>
<ol>
<li><p>Just a small test</p>
<pre><code>This is some code
<pre><code>and some indented code
</code></pre>
</code></pre>
<p>and this is the end </p></li>
</ol>
---------------------------------------------------
Note that there are two code tags for the list, is this to be
expected? have I missed something? is it a bug? or should I just
learn to live with it?
jem
Le 2006-12-29 ? 11:30, Jan Erik Mostr?m a ?crit :> Note that there are two code tags for the list, is this to be > expected? have I missed something? is it a bug? or should I just > learn to live with it?It's clearly a bug since it generates invalid HTML. PHP Markdown has a similar although less problematic bug, where it only double any blank line in code blocks inside list items. It's a bug caused by `doList` adding blank lines as a way to help `processListItems` know if the tailing item needs to be wrapped in a paragraph. Ironically, I just fixed that yesterday after the released PHP Markdown 1.0.1e (so the fix isn't published yet). I noticed it while reading the HTML version of the PHP Markdown release notes I put online yesterday, and I remember having noticed it before too. The fix involves changing the regular expression in `processListItems` so that it doesn't require the additional newlines by adding a look-ahead at the right place, so that `doList` can stop doubling blank lines. Obviously, there's something else at work in the Perl version that cause the nested code block to appear. Michel Fortin michel.fortin at michelf.com http://www.michelf.com/
Jan Erik Mostr?m <lists at mostrom.pp.se> wrote on 12/29/06 at 5:30 PM:>Note that there are two code tags for the list, is this to be >expected? have I missed something? is it a bug? or should I >just learn to live with it?Bug, for sure. First time I've seen it, though. Thanks for the report. --J.G.