From: Gabriel Wicke Date: Sun, 2 May 2004 23:18:25 +0000 (+0000) Subject: experimental fix to the template-inserts-newline-on-save problem X-Git-Tag: 1.3.0beta1~160 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=dea42dfed814affaadb3fcdaaff91e3f1c3ff48c;p=lhc%2Fweb%2Fwiklou.git experimental fix to the template-inserts-newline-on-save problem --- diff --git a/includes/Parser.php b/includes/Parser.php index 1f28f5c344..cd1469b576 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1468,7 +1468,7 @@ class Parser if ( !$found ) { return $matches[0]; } else { - return $newline . $text; + return $text; } } @@ -1515,7 +1515,7 @@ class Parser $htmlattrs = $this->getHTMLattrs () ; # Remove HTML comments - $text = preg_replace( "/\n?\n?/sU", "", $text ); + $text = preg_replace( "/(\n * *(?=\n)|)/sU", "$2", $text ); $bits = explode( "<", $text ); $text = array_shift( $bits );