Merge "Added "maxPartitionsTry" option to JobQueueFederated"
[lhc/web/wiklou.git] / includes / parser / Tidy.php
index e3ea40b..32b16aa 100644 (file)
@@ -61,7 +61,10 @@ class MWTidyWrapper {
 
                // Replace <mw:editsection> elements with placeholders
                $wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
-                       array( &$this, 'replaceEditSectionLinksCallback' ), $text );
+                       array( &$this, 'replaceCallback' ), $text );
+               // ...and <mw:toc> markers
+               $wrappedtext = preg_replace_callback( '/\<\\/?mw:toc\>/',
+                       array( &$this, 'replaceCallback' ), $wrappedtext );
 
                // Modify inline Microdata <link> and <meta> elements so they say <html-link> and <html-meta> so
                // we can trick Tidy into not stripping them out by including them in tidy's new-empty-tags config
@@ -80,7 +83,7 @@ class MWTidyWrapper {
         *
         * @return string
         */
-       function replaceEditSectionLinksCallback( $m ) {
+       function replaceCallback( $m ) {
                $marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
                $this->mMarkerIndex++;
                $this->mTokens->setPair( $marker, $m[0] );
@@ -244,7 +247,7 @@ class MWTidy {
                global $wgTidyConf, $wgDebugTidy;
                wfProfileIn( __METHOD__ );
 
-               if ( !MWInit::classExists( 'tidy' ) ) {
+               if ( !class_exists( 'tidy' ) ) {
                        wfWarn( "Unable to load internal tidy class." );
                        $retval = -1;