public static function tidy( $text ) {
$driver = self::singleton();
if ( !$driver ) {
- throw new MWException( __METHOD__.
+ throw new MWException( __METHOD__ .
': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
}
return $driver->tidy( $text );
}
+ /**
+ * 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.
+ *
+ * @return array
+ */
+ public static function getModuleStyles() {
+ $driver = self::singleton();
+ if ( $driver && $driver instanceof MediaWiki\Tidy\RaggettBase ) {
+ return array( 'mediawiki.raggett' );
+ } else {
+ return array();
+ }
+ }
+
/**
* Check HTML for errors, used if $wgValidateAllHtml = true.
*
public static function checkErrors( $text, &$errorStr = null ) {
$driver = self::singleton();
if ( !$driver ) {
- throw new MWException( __METHOD__.
+ throw new MWException( __METHOD__ .
': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
}
if ( $driver->supportsValidate() ) {