Page MenuHomePhabricator

Support nested special page transclusion
Closed, ResolvedPublic

Description

T59886 handled the case where the special page transclusion was at the top level. The solution there doesn't work if the special page transclusion is nested in a template, as the commit message says,

As a first pass, we call out to the legacy parser for the output of
special pages, which is HTML ($isHTML in Parser.php) and only returned
if asked to render ($this->ot['html'] in Parser.php) as opposed to
template expansion ($this->ot['pre']).

For example:

Event Timeline

MSantos triaged this task as Medium priority.Mar 11 2024, 8:05 PM
MSantos removed a project: Parsoid.

I suggested to @Arlolra that this could be solved by integrating strip state into the parsoid tokenizer. Parsoid expects the result of a transclusion to be "wikitext" and the result of an extension tag expansion to be "html". Both of those are actually incorrect: transclusions (including parser functions) can result in html (returning ["some html string", "isHtml"] as documented by Parser::setFunctionHook) and extension tag expansions can result in wikitext (returning [ 0=>"some html string", "markerType"=>"none"] when called from Parser::extensionSubstitution()).

The solution used in the core parser is to encapsulate the HTML in a strip state marker. Parsoid could integrate "strip state marker" as a token type in its tokenizer, and then use that to fetch the raw html from the strip state and encapsulate it into a DOM Fragment token. That would allow any combination of HTML and wikitext to be handled properly by Parsoid.

This is elaborated on in T257606#9216083.

Bugreporter renamed this task from Support nested special page transclusion? to Support nested special page transclusion.Sep 16 2024, 5:48 PM

Change #1103349 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/core@master] Support nested special page transclusion in Parsoid

https://gerrit.wikimedia.org/r/1103349

Change #1103349 merged by jenkins-bot:

[mediawiki/core@master] Support nested special page transclusion in Parsoid

https://gerrit.wikimedia.org/r/1103349

Change #1113222 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Support nested special page transclusion

https://gerrit.wikimedia.org/r/1113222

As Parsoid is no longer opt-in on French Wiktionary, and as we are impacted by this, please, by all means, the fix should either be expedited or Parsoid be disabled until this is fixed.

Change #1121092 had a related patch set uploaded (by Arlolra; author: Arlolra):

[operations/mediawiki-config@master] Revert parsoid read views on frwiktionary

https://gerrit.wikimedia.org/r/1121092

Change #1121092 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert parsoid read views on frwiktionary

https://gerrit.wikimedia.org/r/1121092

Mentioned in SAL (#wikimedia-operations) [2025-02-19T22:05:42Z] <cjming@deploy2002> Started scap sync-world: Backport for [[gerrit:1121092|Revert parsoid read views on frwiktionary (T356718 T386272)]]

As Parsoid is no longer opt-in on French Wiktionary, and as we are impacted by this, please, by all means, the fix should either be expedited or Parsoid be disabled until this is fixed.

Thanks for escalating the issue. We've reverted the deployment of Parsoid as the default renderer on frwiktionary until this issue is resolved. We do have a fix for it merged above, but it's blocked on a larger dependency which should be coming in a few weeks.

Thanks for the heads-up and the quick answer. Hopefully it'll get back on track soon. Good luck with that.

Change #1123487 had a related patch set uploaded (by Arlolra; author: Arlolra):

[operations/mediawiki-config@master] Enable Parsoid read views for a few wiktionaries

https://gerrit.wikimedia.org/r/1123487

Change #1113222 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Remove native special page transclusion implementation

https://gerrit.wikimedia.org/r/1113222

Change #1124186 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/vendor@master] Bump wikimedia/parsoid to V0.21.0-a19

https://gerrit.wikimedia.org/r/1124186

Change #1124186 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a19

https://gerrit.wikimedia.org/r/1124186

Change #1123487 abandoned by Arlolra:

[operations/mediawiki-config@master] Enable Parsoid read views for a few wiktionaries

Reason:

In favour of I8c592e09449337fd1651db6b9476d9cf78d069b3

https://gerrit.wikimedia.org/r/1123487