BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
MWTidy Class Reference

Static Public Member Functions

static tidy ($text)
 
static getModuleStyles ()
 
static checkErrors ($text, &$errorStr=null)
 
static isEnabled ()
 
static setInstance ($instance)
 
static destroySingleton ()
 

Static Protected Member Functions

static singleton ()
 

Detailed Description

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.

Member Function Documentation

static MWTidy::checkErrors (   $text,
$errorStr = null 
)
static

Check HTML for errors, used if $wgValidateAllHtml = true.

Parameters
string$text
string&$errorStrReturn the error string
Returns
bool Whether the HTML is valid
static MWTidy::destroySingleton ( )
static

Destroy the current singleton instance

static MWTidy::getModuleStyles ( )
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.

Returns
array
static MWTidy::setInstance (   $instance)
static

Set the driver to be used. This is for testing.

Parameters
TidyDriverBase | false | null$instance
static MWTidy::tidy (   $text)
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.

Parameters
string$textHTML input fragment. This should not contain a <body> or <html> tag.
Returns
string Corrected HTML output

The documentation for this class was generated from the following file: