+
+ function renderHtmlDiff() {
+ global $wgOut;
+ wfProfileIn( __METHOD__ );
+
+ $this->showDiffStyle();
+
+ #add deleted rev tag if needed
+ if( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
+ $wgOut->addWikiMsg( 'rev-deleted-text-permission' );
+ } else if( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) {
+ $wgOut->addWikiMsg( 'rev-deleted-text-view' );
+ }
+
+ if( !$this->mNewRev->isCurrent() ) {
+ $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
+ }
+
+ $this->loadText();
+
+ if( is_object( $this->mOldRev ) ) {
+ $wgOut->setRevisionId( $this->mOldRev->getId() );
+ }
+
+ global $wgTitle, $wgParser, $wgTitle;
+ $popts = $wgOut->parserOptions();
+ $oldTidy = $popts->setTidy( TRUE );
+
+ $parserOutput = $wgParser->parse($this->mOldtext, $wgTitle, $popts, TRUE, TRUE, $wgOut->mRevisionId );
+ $popts->setTidy( $oldTidy );
+
+ //only for new?
+ //$wgOut->addParserOutputNoText( $parserOutput );
+ $oldHtml = $parserOutput->getText();
+ wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$oldHtml ) );
+
+ if( is_object( $this->mNewRev ) ) {
+ $wgOut->setRevisionId( $this->mNewRev->getId() );
+ }
+
+ $popts = $wgOut->parserOptions();
+ $oldTidy = $popts->setTidy( TRUE );
+
+ $parserOutput = $wgParser->parse($this->mNewtext, $wgTitle, $popts, TRUE, TRUE, $wgOut->mRevisionId );
+ $popts->setTidy( $oldTidy );
+
+ //only for new?
+ $wgOut->addParserOutputNoText( $parserOutput );
+ $newHtml = $parserOutput->getText();
+ wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$newHtml ) );
+
+ unset($parserOutput,$popts);
+
+ $differ = new HTMLDiffer(new DelegatingContentHandler($wgOut));
+ $differ->htmlDiff($oldHtml, $newHtml);
+
+ wfProfileOut( __METHOD__ );
+ }
+