HTML tags choke templates with parameters, because of a "=" (regardless of being masked by <nowiki>)
Closed, ResolvedPublic

Description

Author: D.U.Thibault

Description:
This template works fine:
<nowiki>
{{User language subcategory|

language-code=fr
language-name=French language
level=0
description=Ces utilisateurs '''[[:Category:User fr-0|ne comprennent pas]]'''

le '''[[:Category:User fr|français]]''' (ou ne le comprennent pas sans grande
difficulté). [[Category:User fr|Français]]
}}
</nowiki>
(It is used in :en:Category:User_fr-0)

However, if we add a font tag to one parameter, the template renders incorrectly:
<nowiki>

description=Ces utilisateurs '''<font color="#FF0000">ne

comprennent pas]]</font>''' le '''[[:Category:User fr|français]]''' (ou ne le
comprennent pas sans grande difficulté). [[Category:User fr|Français]]
</nowiki>
The description appears as "2" within triple curly brackets.


Version: unspecified
Severity: normal
URL: http://en.wikipedia.org/wiki/Category:User_fr-0

bzimport added a project: MediaWiki-Templates.Via ConduitNov 21 2014, 9:08 PM
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz5138.
bzimport created this task.Via LegacyMar 1 2006, 3:14 PM
bzimport added a comment.Via ConduitMar 1 2006, 3:17 PM

D.U.Thibault wrote:

It does not matter where the font tag is inserted: outside the triple
apostrophes, or within the link pipe gives the same effect.

bzimport added a comment.Via ConduitMar 1 2006, 4:38 PM

Wiki.Melancholie wrote:

Yes, the reason is the equal sign "=", so the parser thinks you are specifying
an parameter there!

bzimport added a comment.Via ConduitMar 1 2006, 5:08 PM

Wiki.Melancholie wrote:

Because equals signs sometimes should not indicate that a value for a given
parameter will follow, there is the possibility to include equals signs by typing:
<nowiki>=</nowiki>

But paradoxically this does *not* work if an equal sign is inside a HTML tag
(although the following syntax would work outside of templates!):
<span style<nowiki>=</nowiki>"color: #00FF00;">blabla</span>

bzimport added a comment.Via ConduitApr 5 2006, 11:53 PM

gangleri wrote:

Dear Daniel;

Please see the fix for your request at
http://en.wikipedia.org/w/index.php?title=User:Gangleri/tests/bugzilla/05138/template:User_language_subcategory&diff=47170376&oldid=47169728
I did not like to change the "live" template.

Please follow the links at [[user:Gangleri/tests/bugzilla/05138]].
In [[template:User_language_subcategory]] you will need to use
2={{{description}}}
to achive what you like.

I thing this bug should be closed with resolution INVALID.

*notes*
The safest way to use nested templates is to use named parameters only.

Example: The provided solution would break if you would call
[[template:User_language_subcategory]] with {{{language-code}}} containing a "="
character. Then you would probably need also
1={{{language-code}}}
but I am not shure if "1" is a reserved parameter name or not.

best regards reinhardt [[user:gangleri]]

bzimport added a comment.Via ConduitApr 6 2006, 9:52 AM

gangleri wrote:

Thing about a "real" parser who can identify *<font color="#FF0000">* as an HTML
tag the descibed behaviour is a bug.
Resolution LATER would be more apropriate.
This should be a "testcase", Brion do you agree?

bzimport added a comment.Via ConduitApr 6 2006, 11:57 AM

D.U.Thibault wrote:

Meanwhile, someone found a simpler solution. The color tag is written as « <span style="color:
#FF0000;"> », which does not break rendering.

bzimport added a comment.Via ConduitApr 6 2006, 11:58 AM

D.U.Thibault wrote:

Hmmm...The question marks framing the quotes above are supposed to be guillemets : << >>. Another
bug...

bzimport added a comment.Via ConduitApr 6 2006, 12:30 PM

Wiki.Melancholie wrote:

No, there just has been done what Gangleri wrote in comment #4.
The problem described in comment #3 is still there.

bzimport added a comment.Via ConduitApr 6 2006, 12:35 PM

Wiki.Melancholie wrote:

But the problem of comment #3 only appears
when there is no ...|2={{{...
in [[Template:User_language_subcategory]]

See
http://en.wikipedia.org/w/index.php?title=Template:
User_language_subcategory&diff=prev&oldid=47233590

bzimport added a comment.Via ConduitApr 7 2006, 7:55 PM

D.U.Thibault wrote:

Yup, Melancholie is right: the problem subsists.

bzimport added a comment.Via ConduitOct 12 2006, 3:40 PM

Wiki.Melancholie wrote:

[[de:Vorlage_Diskussion:Link-Bild#Verwendung_der_Vorlage_in_einer_Vorlage]]

bzimport added a comment.Via ConduitApr 7 2007, 1:51 PM

andreas.schwab wrote:

If an url containing a = is used in http://en.wikipedia.org/wiki/Template:Copyvio, it will only show if enclosed in <nowiki>...</nowiki>.
However, it will not shown as a link (in blue with arrow), and one cannot double-click on it. Enclosing just the = sign does not work either.

bzimport added a comment.Via ConduitApr 8 2007, 1:21 PM

ais523 wrote:

You need to quote the parameter with a number, like this: {{copyvio|1=(url=here)}}; if the template uses a named
parameter, like copyvio on :w:en, you can use that instead: {{copyvio|url=(url=here)}}.

bzimport added a comment.Via ConduitJun 4 2007, 6:38 PM

ui2t5v002 wrote:

Equals signs in URLs also break templates, forcing users to type |1=something|2=URL etc. Equals signs inside URLs and HTML should not be interpreted as part of template parameters.

bzimport added a comment.Via ConduitJun 5 2007, 9:08 AM

nicolas.schudel wrote:

A simple way around the URL problem would be to encode the equal signs like "%3D".
For example: url=here -> url%3Dhere

bzimport added a comment.Via ConduitJun 5 2007, 3:23 PM

ayg wrote:

No, because escaping characters like '=' with special meanings in URLs changes the meaning of the URL.

bzimport added a comment.Via ConduitNov 11 2008, 9:25 AM

bretthillebrand wrote:

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

bzimport added a comment.Via ConduitJan 15 2009, 4:41 AM

dhroll wrote:

I have a similar problem regarding the equal sign (=). See [[w:Template:Cite gvp]] http://en.wikipedia.org/wiki/Template:Cite_gvp for an example. I understand that the problem is that the parser interprets any string containing an equals sign as a parameter name. If there is no such parameter name then why should that assumption stand. It goes back to the mindless notion of using unnamed parameters. I sincerely wish you'all luck with this but I'm not to hopeful.

P.Copp added a comment.Via ConduitNov 26 2009, 3:23 AM

Part of this bug, namely the not-working <nowiki>-tags has been fixed with the intoduction of the new preprocessor. The rest is a dupe of bug 14235.

*** This bug has been marked as a duplicate of bug 14235 ***

Add Comment