closing ul/li getting wrapped in p

Stephen Haberman stephenh at chase3000.com
Sat Oct 30 19:54:24 EDT 2004


> $result = "<$list_type>\n" . $result . "</$list_type>\n\n";

Okay, I figured out why the two new lines are required - so that following
text will be wrapped in its own paragraph. I didn't realize I was breaking
that before.

So, here is my new try:

$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>};

So, I keep the two new lines for following text, which now works great when
a list has following text, but then before returning it takes out the double
lines between any two closing tags for sublists and turns it into just a
single new line.

I'm pretty confident in this solution. But I was just as confident in the
last solution, and a lot of good that did me.

Is there an automated test suite for Markdown?

Thanks,
Stephen




More information about the Markdown-discuss mailing list