Page MenuHomePhabricator

ParserOutput::addTemplate() interaction with ParserOptions::getTemplateCallback()
Open, Needs TriagePublic

Description

See T296023 re: Title-related types in this API.

But, further, this method interacts with user hooks. From Parsoid's perspective, Parsoid is given a string title in wikitext. This is then resolved this to an actual revision, maybe with a different title, using the ParserOptions::getTemplateCallback() (aka Parser::statelessFetchTemplate() in most cases) and then *that* thing is what you register with ParserOutput.

But I don't really want any of that to be visible to Parsoid. Once we've passed the string name of the template over to the MediaWiki side for "resolution", I'd prefer that all the details of Title/Revision/id etc *stay* on the MediaWiki side and so the MediaWiki side should be responsible for updating the Template dependencies not Parsoid. OTOH, we need *something* back because eventually Parsoid has to fetch the final resulting title and expand it.

Untangle this mess.