Page MenuHomePhabricator

Allow requesting postprocessed output for some/many/most/all APIs which accept a ParserOption (in some form) and emit a ParserOutput (in some form)
Open, Needs TriagePublic

Description

In the current work for T348255 we've introduced a parser option postproc that requests post-processed output. Initially this parser option will only be recognized/be effective when given to a ParserOutputAccess (Txxxx) but for consistency it should eventually be supported by some/many/most/all APIs which current accept ParserOptions and emit a ParserOutput.

Some of these:

  • Legacy Parser::parse() (maybe?)
  • Content::getParserOutput (ParserOptions provided indirectly via ContentParseParams)
  • RevisionRenderer::getRenderedRevision (accepts ParserOutput, yields RenderedRevision which contains ParserOutput)

Ideally most of the code which currently does something like the examples found at https://codesearch.wmcloud.org/search/?q=DefaultOutputPipeline

		$po = $parser->parse( $wikiContent, $pageTitle, $parserOptions );
		// TODO T371008 consider if using the Content framework makes sense instead of creating the pipeline
		$pipeline = $mwInstance->getDefaultOutputPipeline();
		$options = [ 'deduplicateStyles' => false ];
		return $pipeline->run( $po, $parserOptions, $options );

will instead just set the appropriate flags in ParserOptions and have the pipeline run by whichever method they'd originally called (T371008: Use the Content framework to generate output instead of using Parser directly).

Related Objects