You are here

protected function MarkdownExtra::_doHeaders_callback_atx in Markdown 7

* Callback for atx headers *

Parameters

array $matches: * @return string

Overrides Markdown::_doHeaders_callback_atx

File

includes/MarkdownExtra.php, line 1082

Class

MarkdownExtra
Markdown Extra Parser Class

Namespace

Michelf

Code

protected function _doHeaders_callback_atx($matches) {
  $level = strlen($matches[1]);
  $defaultId = is_callable($this->header_id_func) ? call_user_func($this->header_id_func, $matches[2]) : null;
  $attr = $this
    ->doExtraAttributes("h{$level}", $dummy =& $matches[3], $defaultId);
  $block = "<h{$level}{$attr}>" . $this
    ->runSpanGamut($matches[2]) . "</h{$level}>";
  return "\n" . $this
    ->hashBlock($block) . "\n\n";
}