Fixed Extra's header parser to work correctly with empty list item.

This commit is contained in:
Michel Fortin 2008-06-07 10:18:59 -04:00
parent b784dcd29f
commit 774fe75d47

View file

@ -2209,6 +2209,8 @@ class MarkdownExtra_Parser extends Markdown_Parser {
return " id=\"$attr\"";
}
function _doHeaders_callback_setext($matches) {
if ($matches[3] == '-' && preg_match('{^- }', $matches[1]))
return $matches[0];
$level = $matches[3]{0} == '=' ? 1 : 2;
$attr = $this->_doHeaders_attr($id =& $matches[2]);
$block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>";