function Markdown_Parser::doHeaders in Markdown 6
Same name and namespace in other branches
- 5 markdown.php \Markdown_Parser::doHeaders()
1 method overrides Markdown_Parser::doHeaders()
- MarkdownExtra_Parser::doHeaders in ./markdown.php
File
- ./markdown.php, line 914
Class
- Markdown_Parser
Code
function doHeaders($text) {
$text = preg_replace_callback('{ ^(.+?)[ ]*\\n(=+|-+)[ ]*\\n+ }mx', array(
&$this,
'_doHeaders_callback_setext',
), $text);
$text = preg_replace_callback('{
^(\\#{1,6}) # $1 = string of #\'s
[ ]*
(.+?) # $2 = Header text
[ ]*
\\#* # optional closing #\'s (not counted)
\\n+
}xm', array(
&$this,
'_doHeaders_callback_atx',
), $text);
return $text;
}