function Markdown_Parser::_doCodeBlocks_callback in Markdown 6
Same name and namespace in other branches
- 5 markdown.php \Markdown_Parser::_doCodeBlocks_callback()
File
- ./
markdown.php, line 1135
Class
Code
function _doCodeBlocks_callback($matches) {
$codeblock = $matches[1];
$codeblock = $this
->outdent($codeblock);
$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
# trim leading newlines and trailing newlines
$codeblock = preg_replace('/\\A\\n+|\\n+\\z/', '', $codeblock);
$codeblock = "<pre><code>{$codeblock}\n</code></pre>";
return "\n\n" . $this
->hashBlock($codeblock) . "\n\n";
}