MediaWiki
1.27.0
|
Class to interact with HTML tidy. More...
Static Public Member Functions | |
static | checkErrors ($text, &$errorStr=null) |
Check HTML for errors, used if $wgValidateAllHtml = true. More... | |
static | destroySingleton () |
Destroy the current singleton instance. More... | |
static | getModuleStyles () |
Get CSS modules needed if HTML from the current driver is to be displayed. More... | |
static | isEnabled () |
static | setInstance ($instance) |
Set the driver to be used. More... | |
static | tidy ($text) |
Interface with html tidy. More... | |
Static Protected Member Functions | |
static | singleton () |
Static Private Attributes | |
static | $instance |
Class to interact with HTML tidy.
Either the external tidy program or the in-process tidy extension will be used depending on availability. Override the default $wgTidyInternal setting to disable the internal if it's not working.
Definition at line 33 of file MWTidy.php.
|
static |
Check HTML for errors, used if $wgValidateAllHtml = true.
string | $text | |
string | &$errorStr | Return the error string |
Definition at line 79 of file MWTidy.php.
Referenced by MediaWikiTestCase\assertValidHtmlDocument(), and wfHtmlValidationHandler().
|
static |
Destroy the current singleton instance.
Definition at line 153 of file MWTidy.php.
Referenced by TextContentTest\setUp(), NewParserTest\setupGlobals(), ParserTest\setupGlobals(), SanitizerTest\tearDown(), TextContentTest\tearDown(), NewParserTest\tearDown(), and ParserTest\teardownGlobals().
|
static |
Get CSS modules needed if HTML from the current driver is to be displayed.
This is just a migration tool to allow some changes expected as part of Tidy replacement (T89331) to be exposed on the client side via user scripts, without actually replacing tidy. See T49673.
Definition at line 63 of file MWTidy.php.
Referenced by Parser\internalParseHalfParsed().
|
static |
Definition at line 92 of file MWTidy.php.
Referenced by MediaWikiTestCase\assertValidHtmlDocument(), Parser\internalParseHalfParsed(), Sanitizer\removeHTMLtags(), and TidyTest\setUp().
|
static |
Set the driver to be used.
This is for testing.
TidyDriverBase | false | null | $instance |
Definition at line 146 of file MWTidy.php.
References $instance.
Referenced by SanitizerTest\testRemoveHTMLtags(), and SanitizerTest\testRemovehtmltagsOnHtml5Tags().
|
staticprotected |
Definition at line 96 of file MWTidy.php.
References global, and wfIsHHVM().
|
static |
Interface with html tidy.
If tidy isn't able to correct the markup, the original will be returned in all its glory with a warning comment appended.
string | $text | HTML input fragment. This should not contain a <body> or <html> tag. |
Definition at line 45 of file MWTidy.php.
Referenced by SpecialExpandTemplates\execute(), Parser\internalParseHalfParsed(), and TidyTest\testTidyWrapping().
|
staticprivate |
Definition at line 34 of file MWTidy.php.
Referenced by setInstance().