Index: trunk/extensions/ExpandTemplates/ExpandTemplates_body.php |
— | — | @@ -30,6 +30,7 @@ |
31 | 31 | $this->removeNowiki = $wgRequest->getBool( 'removenowiki', false ); |
32 | 32 | $options = new ParserOptions; |
33 | 33 | $options->setRemoveComments( $this->removeComments ); |
| 34 | + $options->setTidy( true ); |
34 | 35 | $options->setMaxIncludeSize( self::MAX_INCLUDE_SIZE ); |
35 | 36 | if ( $this->generateXML ) { |
36 | 37 | $wgParser->startExternalParse( $title, $options, OT_PREPROCESS ); |
— | — | @@ -51,6 +52,8 @@ |
52 | 53 | $wgOut->addHTML( $this->makeForm( $titleStr, $input ) ); |
53 | 54 | |
54 | 55 | if( $output !== false ) { |
| 56 | + global $wgUseTidy, $wgAlwaysUseTidy; |
| 57 | + |
55 | 58 | if ( $this->generateXML ) { |
56 | 59 | $wgOut->addHTML( $this->makeOutput( $xml, 'expand_templates_xml_output' ) ); |
57 | 60 | } |
— | — | @@ -58,6 +61,9 @@ |
59 | 62 | if ( $this->removeNowiki ) { |
60 | 63 | $tmp = preg_replace( array( '_<nowiki>_', '_</nowiki>_', '_<nowiki */>_' ), '', $tmp ); |
61 | 64 | } |
| 65 | + if( ( $wgUseTidy && $options->getTidy() ) || $wgAlwaysUseTidy ) { |
| 66 | + $tmp = MWTidy::tidy( $tmp ); |
| 67 | + } |
62 | 68 | $wgOut->addHTML( $tmp ); |
63 | 69 | $this->showHtmlPreview( $title, $output, $wgOut ); |
64 | 70 | } |