46 public static function tidy( $text ) {
50 ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
52 return $driver->tidy( $text );
63 public static function checkErrors( $text, &$errorStr =
null ) {
67 ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
69 if ( $driver->supportsValidate() ) {
70 return $driver->validate( $text, $errorStr );
72 throw new MWException( __METHOD__ .
": error text return from HHVM tidy is not supported" );
90 if ( self::$instance ===
null ) {
102 $config[
'driver'] =
'RaggettInternalHHVM';
104 $config[
'driver'] =
'RaggettInternalPHP';
107 $config[
'driver'] =
'RaggettExternal';
124 public static function factory( array $config ) {
125 switch ( $config[
'driver'] ) {
126 case 'RaggettInternalHHVM':
129 case 'RaggettInternalPHP':
132 case 'RaggettExternal':
135 case 'Html5Depurate':
138 case 'Html5Internal':
147 throw new MWException(
"Invalid tidy driver: \"{$config['driver']}\"" );
164 self::$instance =
null;
$wgTidyConf
The path to the tidy config file.
$wgTidyInternal
Set this to true to use the tidy extension.
$wgUseTidy
Set this to true to use the deprecated tidy configuration parameters.
$wgDebugTidy
Put tidy warnings in HTML comments Only works for internal tidy.
$wgTidyBin
The path to the tidy binary.
$wgTidyOpts
The command line options to the tidy binary.
$wgTidyConfig
Configuration for HTML postprocessing tool.
wfIsHHVM()
Check if we are running under HHVM.
Class to interact with HTML tidy.
static factory(array $config)
Create a new Tidy driver object from configuration.
static setInstance( $instance)
Set the driver to be used.
static destroySingleton()
Destroy the current singleton instance.
static checkErrors( $text, &$errorStr=null)
Check HTML for errors, used if $wgValidateAllHtml = true.
static tidy( $text)
Interface with html tidy.