closing ul/li getting wrapped in p

Stephen Haberman stephenh at
Sun Oct 31 23:11:25 EST 2004

> $result = "<$list_type>\n" . $result . "</$list_type>\n\n";
> # Avoid an extra new line after sublists
> $result =~ s{</ul>\n\n</li>}{</ul>\n</li>};

Well. Witness me 1) re-learning Perl and 2) finding that my other changes
were somehow interfering. 

Against a vanilla, this does the trick:

$result =~ s{</ul>\n+</li>}{</ul></li>}g; 

It seems like the \n must be completely gone between </ul> and </li> or else
a double \n\n gets thrown back in and caught by . My previous change had
been removing ul/ol from the block_tags_a|b which when I realized I really
should not do, the rollback to having HashHTMLBlocks go over ul and ol
showed that my previous $result RE did not actually work at all.

> Is there an automated test suite for Markdown?

Sorry for the preliminary emails. I swear it was working fine each time I
sent in an email. I underestimated how my various 'tweaks' were interacting
to cause different results. 

I've now sat on this 3rd email for ~1 day and am still confident in the new
$result =~ RE to correct the mangled sublists.

- Stephen

More information about the Markdown-discuss mailing list