Last modified: 2011-10-19 01:55:06 UTC
Using the #switch ParserFunction, if the default result contains a tag with an attribute, the whole default result is not shown. That problem is not present if the ''#default ='' case is present, or if the tag used does not contain any attribute. Tested live on wikipedia.org MediaWiki 1.18wmf1 (with ParserFunctions Version 1.4.0) and on a private installation MediaWiki 1.17.0 (with ParserFunctions Version 1.4.0) In the following tests, the 5) will not display anything. 1) {{#switch: TEST | TEST = one | #default = <span style="background-color:pink">DEFAULT</span>}} 2) {{#switch: TEST | TEST = one | <span style="background-color:pink">DEFAULT</span>}} 3) {{#switch: TEST1 | TEST = one | #default = <span style="background-color:pink">DEFAULT</span>}} 4) {{#switch: TEST1 | TEST = one | <span>DEFAULT</span>}} 5) {{#switch: TEST1 | TEST = one | <span style="background-color:pink">DEFAULT</span>}}
This is a general problem with the preprocessor and also present, when using span with style in numbered templates param (like some user does in signature). The preprocessor is spliting into name/value at the = and that breaks it. Look at the xml parser tree on [[Special:ExpandTemplates]]. For that reason the #default= is there. For numbered templates you can use 1=.