You are here

function MarkdownExtra_Parser::_doHeaders_callback_setext in Markdown 5

Same name and namespace in other branches
  1. 6 markdown.php \MarkdownExtra_Parser::_doHeaders_callback_setext()

Overrides Markdown_Parser::_doHeaders_callback_setext

File

./markdown.php, line 2229

Class

MarkdownExtra_Parser

Code

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}>";
  return "\n" . $this
    ->hashBlock($block) . "\n\n";
}