MediaWiki  master
MWTidy.php
Go to the documentation of this file.
1 <?php
29 class MWTidy {
30  private static $instance;
31 
42  public static function tidy( $text ) {
43  if ( self::$instance === null ) {
44  global $wgTidyConfig;
45  self::$instance = new MediaWiki\Tidy\RemexDriver( $wgTidyConfig ?? [] );
46  }
47  return self::$instance->tidy( $text );
48  }
49 }
MediaWiki\Tidy\RemexDriver
Definition: RemexDriver.php:12
MWTidy\$instance
static $instance
Definition: MWTidy.php:30
MWTidy
Class to interact with and configure Remex tidy.
Definition: MWTidy.php:29
$wgTidyConfig
$wgTidyConfig
Configuration for HTML postprocessing tool.
Definition: DefaultSettings.php:4645
MWTidy\tidy
static tidy( $text)
Interface with Remex tidy.
Definition: MWTidy.php:42