function Markdown_Parser::_doHeaders_callback_setext in Markdown 6
Same name and namespace in other branches
- 5 markdown.php \Markdown_Parser::_doHeaders_callback_setext()
1 method overrides Markdown_Parser::_doHeaders_callback_setext()
File
- ./
markdown.php, line 944
Class
Code
function _doHeaders_callback_setext($matches) {
# Terrible hack to check we haven't found an empty list item.
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) {
return $matches[0];
}
$level = $matches[2][0] == '=' ? 1 : 2;
$block = "<h{$level}>" . $this
->runSpanGamut($matches[1]) . "</h{$level}>";
return "\n" . $this
->hashBlock($block) . "\n\n";
}