Last modified: 2010-05-15 15:32:53 UTC
The following wikitext: First paragraph. {{stub}} becomes: First paragraph. This article is a stub. This doesn't happen in REL1_3 without Wal's patch for Bug 60, but it happens with Wal's patch applied in both REL1_3 and HEAD. Parser::replaceVariables has these lines: $regex = '/(\\n?){{(['.$nonBraceChars.']*)(\\|.*?|)}}/s'; $text = preg_replace_callback( $regex, 'wfBraceSubstitution', $text ); Parser::braceSubstitution assigns $newline = $matches[1]; but it doesn't use $newline anywhere. Why should newlines in front of {{ be stripped anyway?
newlines weren't stripped in the old code. The code just had to know whether the template was included at the beginning of a line or not. Block elements are treated differently in the two cases.