Merge "API: Add support for documenting dynamic parameters"
[lhc/web/wiklou.git] / includes / parser / MWTidy.php
index 807842b..746e15b 100644 (file)
@@ -45,12 +45,30 @@ class MWTidy {
        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.
         *
@@ -61,7 +79,7 @@ class MWTidy {
        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() ) {