You are here

function MarkdownExtra_Parser::_doHeaders_callback_setext in Markdown 6

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

Overrides Markdown_Parser::_doHeaders_callback_setext

File

./markdown.php, line 2635

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
    ->doExtraAttributes("h{$level}", $dummy =& $matches[2]);
  $block = "<h{$level}{$attr}>" . $this
    ->runSpanGamut($matches[1]) . "</h{$level}>";
  return "\n" . $this
    ->hashBlock($block) . "\n\n";
}