Problem with UL followed by OL

Michel Fortin michel.fortin at michelf.com
Thu Jan 24 23:33:52 EST 2008


I fixed the exact same problem a few years ago in PHP Markdown.
Quoting the version history:


> 1.0.1b (6 Jun 2005)

>

> [...]

>

> * Fix for an ordered list following an unordered list, and the

> reverse.

> There is now a loop in _DoList that does the two separately.


I've looked at your patch and I believe it fixes the problem for
Markdown.pl adequately. But your fix does something different from
mine, which changes the behaviour somewhere else. Try this input:

* first
+ second
- third

With Markdown.pl, you get one unordered list. I'm pretty sure that's
not what you get with your fix applied. When fixing it in PHP Markdown
I decided to diverge the least possible from the previous behaviour
and make sure this was still working as it always has.

Since I plan on adding a test for the above and for the problem you
mentioned in the next version of MDTest (I just realized that there's
no test for it in MDTest), perhaps it'd be a good idea if we can agree
on what the above should be doing.

By the way if anyone wants to take a look at my fix, I suggest you
download PHP Markdown 1.0.1a and 1.0.1b, do a diff, and find the
relevant changes in _DoLists and _ProcessListItems:

<http://michelf.com/docs/projets/php-markdown-1.0.1a.zip>
<http://michelf.com/docs/projets/php-markdown-1.0.1b.zip>


Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Markdown-Discuss mailing list