wiki.techinc.nl/includes/OutputTransform
Isabelle Hurbain-Palatin cd3240f044 Introduce runOutputPipeline and clone by default
This is the third patch of a series of patches to remove
ParserOutput::getText() calls from core. This series of patches should
be functionally equivalent to I2b4bcddb234f10fd8592570cb0496adf3271328e.

Here we temporarily introduce runOutputPipeline in ParserOutput. It
creates and runs the pipeline with default options, and is called by
getText. (This is not entirely truthful because we go through a
runPipelineInternal transient method for null-argument-passing reasons,
but let's not over-complicate this commit message.)

getText is responsible for maintaining the current behaviour,
that is "disallow the cloning of the ParserOutput and putting text back
to as it was" to mitigate T353257. As we get rid of getText, this
behaviour should be moved, if necessary, to the caller site.

The new method is currently added to ParserOutput so that further
refactorings are, for the moment, simpler. It will eventually be moved
to another place within the Content framework.

We also rename 'suppressClone' to 'allowClone' (which is actually its
negation) to avoid multiple levels of negations that make the code
confusing. Note that the default value of 'allowClone' is true, and is
currently overriden in two places: getText and
OutputPage::getParserOutputText (which calls the pipeline directly and
not through ParserOutput).

Bug: T293512
Bug: T371022
Change-Id: Ibf04af1079aaa1934dc78685b00e636ff4d38a9a
2024-09-06 19:06:38 +00:00
..
Stages Move Language and friends into Language namespace 2024-08-10 13:36:30 +02:00
ContentDOMTransformStage.php Make ContentDOMTransformStage not Parsoid specific 2024-08-14 14:23:44 -04:00
ContentTextTransformStage.php Use $stage::CONSTRUCTOR_OPTIONS in DefaultOutputPipelineFactory 2024-06-10 20:53:21 -04:00
DefaultOutputPipelineFactory.php Add OutputPipelineStages from extensions 2024-07-25 11:44:17 -04:00
OutputTransformPipeline.php Introduce runOutputPipeline and clone by default 2024-09-06 19:06:38 +00:00
OutputTransformStage.php Use $stage::CONSTRUCTOR_OPTIONS in DefaultOutputPipelineFactory 2024-06-10 20:53:21 -04:00
README.md

Output transformations pipelines for wikitext

The classes in the Stages/ subdirectory contains HTML and DOM transforms for use in output processing pipelines, i.e. postprocessors for ParserOutput objects that either directly result from a parse or are fetched from ParserCache.

The default pipeline is created by DefaultOutputTransformFactory; it corresponds to what was previously contained in ParserOutput::getText. The shouldRun method in these stages uses defaults that indicates if the stage runs or not in the default OutputTransformPipeline.