Page MenuHomePhabricator

Some transclusions aren't expanding to wikitext and are coming back unchanged
Open, MediumPublic

Description

Some examples are:

From dewiki:

{{subst:#ifeq: {{{2}}} | a | style="line-height: 15px; background: #DDA; border: 3px solid #A86;" | {{subst:#ifeq: {{{2}}} | b | style="line-height: 15px; background: #DDE; border: 3px solid #1874CD;" | style="line-height: 20px; background: #E0E0E0; border: 2px solid #1874CD;"}}}}

From plwiki:

{{państwo dane {{{państwo}}} | infobox państwo/core | wariant ={{{państwo}}} | link | altlink | nazwa |rozmiar }}

Discovered this via infinite loop expansions on some pages:

plwiki/Wikipedysta:Matma_Rex/LOT_Flight_165_hijacking
plwiki/Wikipedysta:El_Slavco/brudnopis
plwiki/Wikipedystka:Wakashimazu/Impuls_Arena

and {{Begrüßungsbox}} transclusion on dewiki.

We should investigate and fix. The infinite loop itself exposed a different bug that is now fixed via https://gerrit.wikimedia.org/r/#/c/189036/. But the original cause of failed expansions is tracked here.

Event Timeline

ssastry created this task.Feb 6 2015, 11:29 PM
ssastry raised the priority of this task from to Medium.
ssastry updated the task description. (Show Details)
ssastry added a project: Parsoid.
ssastry added a subscriber: ssastry.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 6 2015, 11:29 PM

The reason right now is that the PHP API action=expandtemplates returns the same wikitext for those expressions. For example, requestion the expansion of {{subst:echo|foo}} with

https://en.wikipedia.org//w/api.php?action=expandtemplates&format=json&text=%7B%7Bsubst%3Aecho%7Cfoo%7D%7D&prop=wikitext

gives

{
  expandtemplates: {
    wikitext: "{{subst:echo|foo}}"
  }
}

We'll have to detect those cases in Parsoid or add some flag to expantemplates that avoids this behavior.

I think this is because subst: is a PST. This is probably another instance of missing functionality in Parsoid similar to T104523

LGoto moved this task from Needs Triage to Backlog on the Parsoid board.Feb 17 2020, 4:43 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptFeb 17 2020, 4:43 PM