Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| MWTidy | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| tidy | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * HTML validation and correction |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | * @ingroup Parser |
| 8 | */ |
| 9 | |
| 10 | namespace MediaWiki\Parser; |
| 11 | |
| 12 | use MediaWiki\MediaWikiServices; |
| 13 | |
| 14 | /** |
| 15 | * Class to interact with and configure Remex tidy |
| 16 | * |
| 17 | * @ingroup Parser |
| 18 | */ |
| 19 | class MWTidy { |
| 20 | /** |
| 21 | * Interface with Remex tidy. |
| 22 | * If tidy isn't able to correct the markup, the original will be |
| 23 | * returned in all its glory with a warning comment appended. |
| 24 | * |
| 25 | * @param string $text HTML input fragment. This should not contain a |
| 26 | * <body> or <html> tag. |
| 27 | * @return string Corrected HTML output |
| 28 | * @deprecated since 1.36; use MediaWikiServices::getTidy()->tidy() instead |
| 29 | */ |
| 30 | public static function tidy( $text ) { |
| 31 | return MediaWikiServices::getInstance()->getTidy()->tidy( $text ); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | /** @deprecated class alias since 1.43 */ |
| 36 | class_alias( MWTidy::class, 'MWTidy' ); |