Page MenuHomePhabricator

Template, with templated name, that expands to wikitext table syntax fails to parse
Open, LowPublic

Description

From https://www.mediawiki.org/wiki/Topic:Uhivkslralin367t

{| class="wikitable"
{{{{{subst|}}}!}}<div>a</div>
|}

similarly,

{|
{{{{1x|}}!}} hi
|}

Event Timeline

To avoid a click, what I said there was,

It's sort of a bug in Parsoid, it's struggling with the templated template name.

The php parser sees this as {{{subst|}}}, a top-level template argument, whose default value is the empty string. So, gets expanded to {{!}}<div>a</div>, which gives the desired wikitext table syntax.

Substitution (subst) is supposed to occur when saving a page, and shouldn't show up in wikitext.

Strictly speaking, {{!}} is a magic word, not a template. We handle templated template names, but, not templated magic words .. I am not convinced we should support that feature.

As for the subst issue, why is subst showing up in source? It is a PST. so, I am trying to understand why it should be handled in saved source.

Because it's using templatearg syntax, three { instead of two.

FYI: This is the template from where I extracted the example above:
https://pt.wikipedia.org/wiki/Template:Quote?oldid=50958791&action=edit&uselang=en
The syntax was in use before Change 136234 was merged, changing {{!}} from a template into a magic word:
https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/136234/

FYI: This is the template from where I extracted the example above
https://pt.wikipedia.org/wiki/Template:Quote?oldid=50958791&action=edit&uselang=en

Ah, so this isn't even a confusion with PST. Substituição subst is a defined template argument.

ssastry triaged this task as Medium priority.Sep 20 2018, 4:02 PM
ssastry moved this task from Backlog to Edge cases? on the Parsoid-Read-Views board.
LGoto lowered the priority of this task from Medium to Low.Mar 6 2020, 5:24 PM
LGoto moved this task from Read Views to Bugs & Crashers on the Parsoid board.
LGoto moved this task from Bugs & Crashers to Known Differences on the Parsoid board.