Now emmiting <br>s for newlines starting a flat code block (to aleviate inconsistant browser behaviour).
This commit is contained in:
parent
82c323389c
commit
6415572946
1 changed files with 6 additions and 0 deletions
|
|
@ -2396,9 +2396,15 @@ class MarkdownExtra_Parser extends Markdown_Parser {
|
|||
function _doCodeBlocks_flat_callback($matches) {
|
||||
$codeblock = $matches[2];
|
||||
$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
|
||||
$codeblock = preg_replace_callback('/^\n+/',
|
||||
array(&$this, '_doCodeBlocks_flat_newlines'), $codeblock);
|
||||
$codeblock = "<pre><code>$codeblock</code></pre>";
|
||||
return "\n\n".$this->hashBlock($codeblock)."\n\n";
|
||||
}
|
||||
function _doCodeBlocks_flat_newlines($matches) {
|
||||
return str_repeat("<br$this->empty_element_suffix",
|
||||
strlen($matches[0]));
|
||||
}
|
||||
|
||||
|
||||
function doItalicsAndBold($text) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue