Topic on Extension talk:Linter

He7d3r (talkcontribs)

Why is this considered a "Fostered content" error?

{| class="wikitable"
{{{{{subst|}}}!}}<div>a</div>
|}
This post was hidden by Bdijkstra (history)
Arlolra (talkcontribs)

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.

Arlolra (talkcontribs)
SSastry (WMF) (talkcontribs)

I've responded there, but why is the subst showing up in saved source? Or is the complaint that Parsoid isn't handling PST before saving?

Arlolra (talkcontribs)

The author used the wrong syntax, three { instead of two.

Verdy p (talkcontribs)

three braces are OK for this case use inside a template. It means taking parameter whose name is subst, and if it is not passed by the page transcluding the template, use a default empty text value.

The role of this parameter in any template "X" is to:

  • pass either "|subst=" (i.e. empty text, the default value), so that the code {{!}} will be used (and saved under this form on editing and saving the page making the transclusion of "X")
  • or pass "|subst=subst:", so that the | will be used (when saving the page using the template "X", and if the template X itself was "subst:'ed" as {{subst:X|...|subst=subst:}}, then that page will not be saved to contain {{subst:!}} or {{!}}, but its expansion (to a pipe character).
SSastry (WMF) (talkcontribs)

But, {{{subst}}} substs .. i just tested ...

SSastry (WMF) (talkcontribs)

oh .. never mind ... i see what you are saying about top-level argument.

Reply to "Fostered content"