From: Jens Frank Date: Sat, 18 Sep 2004 21:02:27 +0000 (+0000) Subject: BUG#523 Don't remove newlines in front of templates or template variables X-Git-Tag: 1.5.0alpha1~1963 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=9a3b767c7db7303e340389fdb4474d99b2a32b6b;p=lhc%2Fweb%2Fwiklou.git BUG#523 Don't remove newlines in front of templates or template variables --- diff --git a/includes/Parser.php b/includes/Parser.php index 30eb6b5596..6af5994d46 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1443,10 +1443,10 @@ class Parser if ( $this->mOutputType == OT_HTML ) { # Argument substitution - $text = preg_replace_callback( "/(\\n?){{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text ); + $text = preg_replace_callback( "/{{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text ); } # Template substitution - $regex = '/(\\n?){{(['.$nonBraceChars.']*)(\\|.*?|)}}/s'; + $regex = '/{{(['.$nonBraceChars.']*)(\\|.*?|)}}/s'; $text = preg_replace_callback( $regex, 'wfBraceSubstitution', $text ); array_pop( $this->mArgStack ); @@ -1502,15 +1502,13 @@ class Parser $title = NULL; - # $newline is an optional newline character before the braces # $part1 is the bit before the first |, and must contain only title characters # $args is a list of arguments, starting from index 0, not including $part1 - $newline = $matches[1]; - $part1 = $matches[2]; - # If the third subpattern matched anything, it will start with | + $part1 = $matches[1]; + # If the second subpattern matched anything, it will start with | - $args = $this->getTemplateArgs($matches[3]); + $args = $this->getTemplateArgs($matches[2]); $argc = count( $args ); # {{{}}} @@ -1719,8 +1717,7 @@ class Parser # Triple brace replacement -- used for template arguments function argSubstitution( $matches ) { - $newline = $matches[1]; - $arg = trim( $matches[2] ); + $arg = trim( $matches[1] ); $text = $matches[0]; $inputArgs = end( $this->mArgStack );