Adding a data-mw-parsoid-version attribute to the wrapper div helps to
unambiguously mark parsoid-generated output in a way which is compatible
with CSS rules and client-side JavaScript.
By embedding the current version of parsoid in the data attribute,
sophisticated CSS rules can match against a specific version of
Parsoid in order to facilitate proper behavior; for example:
div[data-mw-parsoid-version^="0.20.0"]
This could be useful in deployment scenarios where the parser cache
might contain content generated by older or newer versions of Parsoid,
for roll-forward or roll-back deployment scenarios, respectively.
Bug: T363378
Change-Id: I941d31479eebb12ea1f4dcdb0a1737033ddc8ac1
|
||
|---|---|---|
| .. | ||
| Stages | ||
| ContentDOMTransformStage.php | ||
| ContentTextTransformStage.php | ||
| DefaultOutputPipelineFactory.php | ||
| OutputTransformPipeline.php | ||
| OutputTransformStage.php | ||
| 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.