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

Static Public Member Functions

static tidy ($text)
 
static isEnabled ()
 
static singleton ()
 
static factory (array $config)
 
static setInstance ($instance)
 
static destroySingleton ()
 

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::destroySingleton ( )
static

Destroy the current singleton instance

static MWTidy::factory ( array  $config)
static

Create a new Tidy driver object from configuration.

See Also
$wgTidyConfig
Parameters
array$config
Returns
bool|
Exceptions
MWException
static MWTidy::isEnabled ( )
static
Returns
bool
static MWTidy::setInstance (   $instance)
static

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

Parameters
MediaWiki\Tidy\TidyDriverBase | false | null$instance
static MWTidy::singleton ( )
static
Returns
bool|
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
Exceptions
MWException

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