For MediaWiki (recent comments | status changes | tags | authors | states | release notes)
Index: trunk/phase3/includes/parser/Parser.php =================================================================== --- trunk/phase3/includes/parser/Parser.php (revision 42256) +++ trunk/phase3/includes/parser/Parser.php (revision 42257) @@ -665,9 +665,14 @@ */ function tidy( $text ) { global $wgTidyInternal; + $wrappedtext = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'. ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>'. '<head><title>test</title></head><body>'.$text.'</body></html>'; + + # Tidy is known to clobber tabs; convert 'em to entities + $wrappedtext = str_replace("\t", '	', $wrappedtext); + if( $wgTidyInternal ) { $correctedtext = self::internalTidy( $wrappedtext ); } else { @@ -677,6 +682,10 @@ wfDebug( "Tidy error detected!\n" ); return $text . "\n<!-- Tidy found serious XHTML errors -->\n"; } + + # Convert the tabs back from entities + $correctedtext = str_replace('	', "\t", $correctedtext); + return $correctedtext; }
whee
There is a tiny possibility that this might clobber JS code in CDATA sections, but practically I think it will not be an issue. :) In that case the literal \t will probably be fine. ;)
This revision breaks <inputbox>, see bugzilla:16108.
What's it fixing? We have always had tabs on the wiki without this conversion.