Page MenuHomePhabricator

Template arguments not parsed.
Closed, InvalidPublic

Description

Author: Astronouth7303

Description:
Under certain circumstances, the argument for a template will not be replaced.
As in above, the line is:
{{default value| array ( 'user' => 1, 'sysop' => 1, 'developer' => 1 ) }}

[[Template:Default value]] is:
:'''Default Value''' - <code>{{{1}}}</code>

The resultant HTML code is:
<dl>
<dd><b>Default Value</b> - <code>{{{1}}}</code></dd>

</dl>


Version: 1.4.x
Severity: normal
OS: Windows XP
Platform: PC
URL: http://meta.wikimedia.org/wiki/Help:Configuration_settings_index#.24wgWhitelistAccount

Details

Reference
bz1979

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:20 PM
bzimport set Reference to bz1979.
bzimport added a subscriber: Unknown Object (MLST).

rowan.collins wrote:

(In reply to comment #0)

Under certain circumstances, the argument for a template will not be replaced.

The argument *is* being replaced, but unfortunately the parser is seeing what
humans generally wouldn't - the text contains an "=", which is used to form
"name=value" pairs. Thus, it is not creating an unnamed parameter called "1",
it's creating a named parameter, with the name as everything to the first '='.

:: So by placing
{{{array ( 'user'}}}
:: in meta:sandbox, the following
{{meta:sandbox|array ( 'user' => 1, 'sysop' => 1, 'developer' => 1 )}}
:: becomes the following

1, 'sysop' => 1, 'developer' => 1 )

It would be nice to have some special easy way of "escaping" instances of '='
and '|' within the template syntax, but this *is* expected behaviour.
For now, you can work around it by replacing all '=' with the HTML escaped
version, &#61; (I've now done this in the paragraph linked)

Astronouth7303 wrote:

(In reply to comment #1)

It would be nice to have some special easy way of "escaping" instances of '='
and '|' within the template syntax, but this *is* expected behaviour.

<nowiki> seems work.

For now, you can work around it by replacing all '=' with the HTML escaped
version, &#61; (I've now done this in the paragraph linked)

This didn't seem to help, but it may have been my caching.

Anyway, <nowiki> makes more sense.