46 public static function tidy( $text ) {
50 ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
52 return $driver->tidy( $text );
69 if ( self::$instance ===
null ) {
81 $config[
'driver'] =
'RaggettInternalHHVM';
83 $config[
'driver'] =
'RaggettInternalPHP';
86 $config[
'driver'] =
'RaggettExternal';
103 public static function factory( array $config ) {
104 switch ( $config[
'driver'] ) {
105 case 'RaggettInternalHHVM':
108 case 'RaggettInternalPHP':
111 case 'RaggettExternal':
114 case 'Html5Depurate':
117 case 'Html5Internal':
126 throw new MWException(
"Invalid tidy driver: \"{$config['driver']}\"" );
143 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 tidy( $text)
Interface with html tidy.