Page MenuHomePhabricator

Span tags visible in VEdit mode
Closed, ResolvedPublic

Description

This was noted on fr.wiki, see the infobox while in VEdit mode at https://fr.wikipedia.org/w/index.php?title=Archosauria&veaction=edit .

I discussed this with Roan on IRC and he provided a simpler testcase at https://fr.wikipedia.org/wiki/Utilisateur:Roan_Kattouw_(WMF)/sandbox (compare read mode and VE mode there).
Excerpts from our conversation:

R: OK http://parsoid-lb.eqiad.wikimedia.org/frwiki/Archosauria?oldid=109663868 shows the same, so it's a Parsoid bug

<td>&lt;span class<span typeof="mw:Nowiki" data-parsoid="{}">=</span>"normal"&gt;<a rel="mw:WikiLink" href="./Animalia" title="Animalia" >Animalia</a></td>

The = is surrounded with <nowiki> and maybe that's why Parsoid is tripping

Oh the <nowiki>=</nowiki> comes from {{=}}

Related Objects

Event Timeline

Elitre raised the priority of this task from to Needs Triage.
Elitre updated the task description. (Show Details)
Elitre added a project: Parsoid.
Elitre changed Security from none to None.
Elitre added a subscriber: Elitre.

Yes, the nowiki is getting in the way .. <span class<nowiki>=</nowiki>"normal">..</span> doesn't parse to a span tag in parsoid. The nowiki screws it up. Is there a reason for the <nowiki> around the = in frwiki? I see that enwiki doesn't have it (https://en.wikipedia.org/w/index.php?title=Template:%3D&action=edit)

So we're back to T59141 , for sure, it's a WP:fr internal problem but I do not know why this appear this week.

I am sure this has always been rendering as text in Parsoid/VE, but maybe only noticed now?

Is there a reason for the <nowiki> around the = in frwiki? I see that enwiki doesn't have it (https://en.wikipedia.org/w/index.php?title=Template:%3D&action=edit)

Presumably it's because they want to escape the equals sign. {{foo|<span class=foo...}} is interpreted as setting the parameter named <span class to the value foo.... There are two ways around this. The most common one is to write {{foo|1=<span class=foo...}}, and another (which I only learned about today) is to write a {{=}} template that outputs <nowiki>=</nowiki> and then write {{foo|<span class{{=}}foo...}}

(Note that HTML tags aren't generally the most common context for escaping equals signs; usually it's URLs.)

But, you don't need the nowiki in the template source for Template:= for the {{foo|<span class{{=}}bar>..</span>}} usage, do you?

Taxobox is a quite complicated template so we have a sandbox for test:Taxoessai
I've just delete {{ }} in https://fr.wikipedia.org/w/index.php?title=Modèle:Taxoessai&diff=prev&oldid=109991493 and everything seems fine : https://fr.wikipedia.org/w/index.php?title=Utilisateur:Drongou/Test2&oldid=109993255&veaction=edit
Where it works it's taxoessai, where it doesn't work it's taxobox, why it works I don't really know ...
Taxobox is a massively used template (in 90716 pages on WP:fr), I'm absolutely sure the problem was hidden up to last week.

expandtemplates API on the #ifeq parser function expands it to a valid HTML syntax. In turn, this is because key=value is output as is. value is not set to be value of the parameter named key as it is with templates. http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23ifeq indicates that the param strings of the form key=value are interpreted as an atomic value rather than as a named argument.

[subbu@earth lib] echo '{{#ifeq:{{Taxoboxoutils infgenre|{{{1|}}}}}|0|<span class="normal">}}' | node parse --prefix frwiki --dump tplsrc
...
<span class="normal">
...
[subbu@earth lib] echo '{{#ifeq:{{Taxoboxoutils infgenre|{{{1|}}}}}|0|<span class{{=}}"normal">}}' | node parse --prefix frwiki --dump tplsrc
...
<span class<nowiki>=</nowiki>"normal">
...

The change is done on WP:fr and works fine
your advice to remove nowiki in {{=}} have been seen and will be tested

Thank you for your assistance

The change is done on WP:fr and works fine
your advice to remove nowiki in {{=}} have been seen and will be tested

Thank you for your assistance

I am glad it worked out. Happy to be of assistance. :-)

ssastry triaged this task as Medium priority.