X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FWikitextContent.php;h=26337db947dea7fd64fbcab39e7b0433fc940e01;hb=8734fe02b84c0fdd6fa53454b23ce9239b50dc75;hp=d821d9d75d245688bf460654118e0e7478676ece;hpb=9e0e8abd7eac4c16b22a0ff7c8381f0f7ecccf64;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index d821d9d75d..26337db947 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -277,21 +277,28 @@ class WikitextContent extends TextContent { * using $wgParser. * * @since 1.21 - * @see AbstractContent::fillParserOutput(). * * @param $title Title * @param int $revId Revision to pass to the parser (default: null) * @param $options ParserOptions (default: null) * @param bool $generateHtml (default: false) - * @param &$output ParserOutput representing the HTML form of the text, - * may be manipulated or replaced. + * + * @internal param \IContextSource|null $context + * @return ParserOutput representing the HTML form of the text */ - protected function fillParserOutput( Title $title, $revId, - ParserOptions $options, $generateHtml, ParserOutput &$output + public function getParserOutput( Title $title, + $revId = null, + ParserOptions $options = null, $generateHtml = true ) { global $wgParser; - $output = $wgParser->parse( $this->getNativeData(), $title, $options, true, true, $revId ); + if ( !$options ) { + //NOTE: use canonical options per default to produce cacheable output + $options = $this->getContentHandler()->makeParserOptions( 'canonical' ); + } + + $po = $wgParser->parse( $this->getNativeData(), $title, $options, true, true, $revId ); + return $po; } protected function getHtml() {