Last modified: 2011-10-19 01:55:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T33781, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31781 - In a #switch, default result not shown if it contains a tag with an attribute and #default is not used
In a #switch, default result not shown if it contains a tag with an attribute...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: parser
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-17 18:31 UTC by Alexandre Vaillancourt
Modified: 2011-10-19 01:55 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Alexandre Vaillancourt 2011-10-17 18:31:21 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>}}
Comment 1 db [inactive,noenotif] 2011-10-17 19:41:22 UTC
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=.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links