Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now emmiting <br>s for newlines starting a flat code block (to alevia…

…te inconsistant browser behaviour).
  • Loading branch information...
commit 64155729469f8c61ce107c6ad244b151cdd027ef 1 parent 82c3233
@michelf authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 markdown.php
View
6 markdown.php
@@ -2396,9 +2396,15 @@ function doCodeBlocks($text) {
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) {
Please sign in to comment.
Something went wrong with that request. Please try again.