Page MenuHomePhabricator

No (or broken) whitespace stripping in unnamed template parameter values.
Closed, DeclinedPublic


Author: cogden

Normally, whitespace is stripped from the beginning and end of template parameters. When the parameter is unnamed, however, whitespace stripping does not occur. In [[m:Help:Newlines and spaces]] and [[m:Help:Template#Stripping of spaces and newlines]], this is described as a "probable bug", and I agree, since there appears to be no logical reason for the inconsistency. It also leads to unexpected results and confusion in Wikipedia template calls, and there is no apparent workaround. Can this inconsistency be addressed?

Version: 1.12.x
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:55 PM
bzimport set Reference to bz11375.
bzimport added a subscriber: Unknown Object (MLST).

bluehairedlawyer wrote:

*** Bug 8533 has been marked as a duplicate of this bug. ***

bluehairedlawyer wrote:

stirp unnamed params

The software makes white-space stripping from named parameters as something for backward compatibility. However it seems to be an almost universal assumption that unnamed parameters should be treated in the same way a named ones and it makes sense for consistency.


bluehairedlawyer wrote:

That should have been "The software marks", not "makes".

This behaviour has always been present, and was reimplemented at great cost when the preprocessor was rewritten for MW 1.12, because reproducing this whitespace behaviour precisely was the only way to avoid breaking large numbers of existing templates.

Actually, it's the stripping around named parameters that is wrong. Newlines in front of tokens that need to be at the beginning of a line should never be stripped.