Index: Preprocessor_DOM.php =================================================================== --- Preprocessor_DOM.php (revision 46444) +++ Preprocessor_DOM.php (working copy) @@ -1253,8 +1253,9 @@ return false; } if ( !isset( $this->numberedExpansionCache[$index] ) ) { - # No trimming for unnamed arguments - $this->numberedExpansionCache[$index] = $this->parent->expand( $this->numberedArgs[$index], self::STRIP_COMMENTS ); + # trim args + $this->numberedExpansionCache[$index] = + trim( $this->parent->expand( $this->numberedArgs[$index], self::STRIP_COMMENTS ) ); } return $this->numberedExpansionCache[$index]; } @@ -1264,9 +1265,9 @@ return false; } if ( !isset( $this->namedExpansionCache[$name] ) ) { - # Trim named arguments post-expand, for backwards compatibility - $this->namedExpansionCache[$name] = trim( - $this->parent->expand( $this->namedArgs[$name], self::STRIP_COMMENTS ) ); + # trim args + $this->namedExpansionCache[$name] = + trim( $this->parent->expand( $this->namedArgs[$name], self::STRIP_COMMENTS ) ); } return $this->namedExpansionCache[$name]; } Index: Preprocessor_Hash.php =================================================================== --- Preprocessor_Hash.php (revision 46444) +++ Preprocessor_Hash.php (working copy) @@ -1206,8 +1206,9 @@ return false; } if ( !isset( $this->numberedExpansionCache[$index] ) ) { - # No trimming for unnamed arguments - $this->numberedExpansionCache[$index] = $this->parent->expand( $this->numberedArgs[$index], self::STRIP_COMMENTS ); + # trim args + $this->numberedExpansionCache[$index] = trim( + $this->parent->expand( $this->numberedArgs[$index], self::STRIP_COMMENTS ) ); } return $this->numberedExpansionCache[$index]; } @@ -1217,7 +1218,7 @@ return false; } if ( !isset( $this->namedExpansionCache[$name] ) ) { - # Trim named arguments post-expand, for backwards compatibility + # trim args $this->namedExpansionCache[$name] = trim( $this->parent->expand( $this->namedArgs[$name], self::STRIP_COMMENTS ) ); }