/**
  * Returns a ParserOutput object resulting from parsing the content's text
  * using $wgParser.
  *
  * @param Title $title
  * @param int $revId Revision to pass to the parser (default: null)
  * @param ParserOptions $options (default: null)
  * @param bool $generateHtml (default: true)
  * @param ParserOutput &$output ParserOutput representing the HTML form of the text,
  *           may be manipulated or replaced.
  */
 protected function fillParserOutput(Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output)
 {
     global $wgParser;
     list($redir, $text) = $this->getRedirectTargetAndText();
     $output = $wgParser->parse($text, $title, $options, true, true, $revId);
     // Add redirect indicator at the top
     if ($redir) {
         // Make sure to include the redirect link in pagelinks
         $output->addLink($redir);
         if ($generateHtml) {
             $chain = $this->getRedirectChain();
             $output->setText(Article::getRedirectHeaderHtml($title->getPageLanguage(), $chain, false) . $output->getText());
             $output->addModuleStyles('mediawiki.action.view.redirectPage');
         }
     }
 }
 /**
  * Returns a ParserOutput object resulting from parsing the content's text
  * using $wgParser.
  *
  * @since    1.21
  *
  * @param $title Title
  * @param int $revId Revision to pass to the parser (default: null)
  * @param $options ParserOptions (default: null)
  * @param bool $generateHtml (default: false)
  *
  * @internal param \IContextSource|null $context
  * @return ParserOutput representing the HTML form of the text
  */
 public function getParserOutput(Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true)
 {
     global $wgParser;
     if (!$options) {
         //NOTE: use canonical options per default to produce cacheable output
         $options = $this->getContentHandler()->makeParserOptions('canonical');
     }
     list($redir, $text) = $this->getRedirectTargetAndText();
     $po = $wgParser->parse($text, $title, $options, true, true, $revId);
     // Add redirect indicator at the top
     if ($redir) {
         // Make sure to include the redirect link in pagelinks
         $po->addLink($redir);
         if ($generateHtml) {
             $chain = $this->getRedirectChain();
             $po->setText(Article::getRedirectHeaderHtml($title->getPageLanguage(), $chain, false) . $po->getText());
         }
     }
     return $po;
 }