From: Derk-Jan Hartman Date: Mon, 5 May 2014 00:08:10 +0000 (+0200) Subject: Special:ExpandTemplates: Load RL modules X-Git-Tag: 1.31.0-rc.0~15299^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=5573d65bcf6587b41fea731ebe4686157602c129;p=lhc%2Fweb%2Fwiklou.git Special:ExpandTemplates: Load RL modules Bug: 39049 Change-Id: I85d0c820d7fb5e3faa0081bf2e8e4672f2887b38 --- diff --git a/includes/specials/SpecialExpandTemplates.php b/includes/specials/SpecialExpandTemplates.php index f89f03cc75..35a3ba113d 100644 --- a/includes/specials/SpecialExpandTemplates.php +++ b/includes/specials/SpecialExpandTemplates.php @@ -118,13 +118,13 @@ class SpecialExpandTemplates extends SpecialPage { $out->addHTML( $tmp ); - $rawhtml = $this->generateHtml( $title, $output ); - + $pout = $this->generateHtml( $title, $output ); + $rawhtml = $pout->getText(); if ( $this->generateRawHtml && strlen( $rawhtml ) > 0 ) { $out->addHTML( $this->makeOutput( $rawhtml, 'expand_templates_html_output' ) ); } - $this->showHtmlPreview( $title, $rawhtml, $out ); + $this->showHtmlPreview( $title, $pout, $out ); } } @@ -222,26 +222,24 @@ class SpecialExpandTemplates extends SpecialPage { * * @param Title $title * @param string $text - * @return string + * @return ParserOutput */ private function generateHtml( Title $title, $text ) { global $wgParser; $popts = ParserOptions::newFromContext( $this->getContext() ); $popts->setTargetLanguage( $title->getPageLanguage() ); - $pout = $wgParser->parse( $text, $title, $popts ); - - return $pout->getText(); + return $wgParser->parse( $text, $title, $popts ); } /** * Wraps the provided html code in a div and outputs it to the page * * @param Title $title - * @param string $html + * @param ParserOutput $pout * @param OutputPage $out */ - private function showHtmlPreview( Title $title, $html, OutputPage $out ) { + private function showHtmlPreview( Title $title, ParserOutput $pout, OutputPage $out ) { $lang = $title->getPageViewLanguage(); $out->addHTML( "

" . $this->msg( 'expand_templates_preview' )->escaped() . "

\n" ); $out->addHTML( Html::openElement( 'div', array( @@ -249,7 +247,7 @@ class SpecialExpandTemplates extends SpecialPage { 'dir' => $lang->getDir(), 'lang' => $lang->getHtmlCode(), ) ) ); - $out->addHTML( $html ); + $out->addParserOutputContent( $pout ); $out->addHTML( Html::closeElement( 'div' ) ); }