How can I use a '=' character in a template parameter without breaking the template parser? I'm not a MediaWIKI developer so I haven't debugged the code or checked the logs, I'm hoping someone here has a tip for escaping characters passed to templates.
Create a template called "Test" with this content:
{{{1}}}
Like this:
{{ Test | R = 3/(2-(1+1)) }}
Will render {{{1}}} instead of the complex formula! I've determined the '=' character is the culprit.
If a MediaWiki template parameter string contains an equals sign, everything before the sign is taken to be the name of the parameter. If it does not contain an equals sign, the parameter string is assigned to the next available numeric parameter.
Thus, the simplest workaround, if you actually want a numbered parameter value to contain an equals sign, is to explicitly number it, like this:
This will cause
{{{1}}}
inside the template to expand to the stringR = 3/(2-(1+1))
, just as:will cause
{{{equation}}}
to expand to that same string.