Page MenuHomePhabricator

Parsoid PageConfigFactory should accept a revision record, not wikitextOverride
Open, MediumPublic


You can create a new MutableRevisionRecord if you want to override wikitext, but in most cases the input to PageConfigFactory is a revision.

Right now we pass in the revid and then have a lot of tricky code in PageConfigFactory::create() to lookup the revid and/or create a MutableRevisionRecord. This code should be moved into the callers -- ParserTestRunner (for example) already has code to create a mock RevisionRecord with a specific revid and wikitext for its test cases.

This would also allow parser tests to override $revId for tests like the legacy parser does. With the lookup embedded inside PageConfigFactory::create() it's difficult to supply a fake revID without causing the lookup in PageConfigFactory to break.

Event Timeline

ssastry triaged this task as Medium priority.Dec 16 2020, 4:36 PM
ssastry updated the task description. (Show Details)
ssastry moved this task from Needs Triage to Tech Debt / Big changes on the Parsoid board.