/**
  * Append preview output to $wgOut.
  * Includes category rendering if this is a category page.
  *
  * @param $text String: the HTML to be output for the preview.
  */
 protected function showPreview($text)
 {
     global $wgOut;
     if ($this->mTitle->getNamespace() == NS_CATEGORY) {
         $this->mArticle->openShowCategory();
     }
     # This hook seems slightly odd here, but makes things more
     # consistent for extensions.
     wfRunHooks('OutputPageBeforeHTML', array(&$wgOut, &$text));
     $wgOut->addHTML($text);
     if ($this->mTitle->getNamespace() == NS_CATEGORY) {
         $this->mArticle->closeShowCategory();
     }
 }