quieter tidy errors
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 29 May 2004 04:51:29 +0000 (04:51 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 29 May 2004 04:51:29 +0000 (04:51 +0000)
includes/Parser.php

index 836e85a..0afa39d 100644 (file)
@@ -419,6 +419,9 @@ class Parser
        function tidy ( $text ) {
                global $wgTidyConf, $wgTidyBin, $wgTidyOpts;
                global $wgInputEncoding, $wgOutputEncoding;
+               $fname = "Parser::tidy";
+               wfProfileIn( $fname );
+               
                $cleansource = '';
                switch(strtoupper($wgOutputEncoding)) {
                        case 'ISO-8859-1':
@@ -449,8 +452,12 @@ class Parser
                        fclose($pipes[1]);
                        $return_value = proc_close($process);
                }
+
+               wfProfileOut( $fname );
+               
                if( $cleansource == '' && $text != '') {
-                       return '<h2>'.wfMsg('seriousxhtmlerrors').'</h2><pre>'.htmlspecialchars($text).'</pre>';
+                       wfDebug( "Tidy error detected!\n" );
+                       return $text . "\n<!-- Tidy found serious XHTML errors -->\n";
                } else {
                        return $cleansource;
                }