Merge "Allow preloadparams for Special:MyPage"
[lhc/web/wiklou.git] / includes / parser / MWTidy.php
index f7fe5a8..b310862 100644 (file)
@@ -65,7 +65,9 @@ class MWTidyWrapper {
                // ...and <mw:toc> markers
                $wrappedtext = preg_replace_callback( '/\<\\/?mw:toc\>/',
                        array( &$this, 'replaceCallback' ), $wrappedtext );
-
+               // ... and <math> tags
+               $wrappedtext = preg_replace_callback( '/\<math(.*?)\<\\/math\>/s',
+                       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
                $wrappedtext = preg_replace( '!<(link|meta)([^>]*?)(/{0,1}>)!', '<html-$1$2$3', $wrappedtext );
@@ -83,7 +85,7 @@ class MWTidyWrapper {
         *
         * @return string
         */
-       function replaceCallback( $m ) {
+       public function replaceCallback( $m ) {
                $marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
                $this->mMarkerIndex++;
                $this->mTokens->setPair( $marker, $m[0] );