This class contains helper functions which should not be directly used outside of Parsoid.
More...
|
static | encodeXml (string $str) |
| Little helper function for encoding XML entities.
|
|
static | normalizeAbout (string $str) |
| Strip the actual about id from the string.
|
|
static | normalizeOut ( $domBody, array $options=[]) |
| Specialized normalization of the PHP parser & Parsoid output, to ignore a few known-ok differences in parser test runs.
|
|
static | stripParsoidIds (string $s) |
| Strip Parsoid ID attributes (id="mwXX", used to associate NodeData) from an HTML string.
|
|
static | unwrapSpansAndNormalizeIEW (Element $body, ?string $stripSpanTypeof=null, bool $parsoidOnly=false, bool $preserveIEW=false) |
| Normalize newlines in IEW to spaces instead.
|
|
static | normalizePhpOutput (string $html) |
| Strip some php output we aren't generating.
|
|
static | normalizeHTML (string $source) |
| Normalize the expected parser output by parsing it using a HTML5 parser and re-serializing it to HTML.
|
|
static | colorString (string $string, string $color, bool $inverse=false) |
|
This class contains helper functions which should not be directly used outside of Parsoid.
Per T332457, most of the code in Wikimedia\Parsoid\ParserTests is "for use in parser test runners only", including the core parser test runner, but this file is "more internal" than that: core's parser test runner should not use these helpers directly.
static Wikimedia\Parsoid\ParserTests\TestUtils::normalizeOut |
( |
| $domBody, |
|
|
array | $options = [] ) |
|
static |
Specialized normalization of the PHP parser & Parsoid output, to ignore a few known-ok differences in parser test runs.
This code is also used by the Parsoid round-trip testing code.
If parsoidOnly is true-ish, we allow more markup through (like property and typeof attributes), for better checking of parsoid-only test cases.
- Parameters
-
Element | string | $domBody | |
array | $options |
- parsoidOnly (bool) Is this test Parsoid Only? Optional. Default: false
- preserveIEW (bool) Should inter-element WS be preserved? Optional. Default: false
- hackyNormalize (bool) Apply the normalizer to the html. Optional. Default: false
|
- Returns
- string