Markdown markup question

Michel Fortin michel.fortin at michelf.com
Fri Dec 29 15:02:39 EST 2006


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/




More information about the Markdown-Discuss mailing list