if( is_object( $this->mNewRev ) ) {
$wgOut->setRevisionId( $this->mNewRev->getId() );
}
- $wgOut->addWikiText( $this->mNewtext );
+ $wgOut->addSecondaryWikiText( $this->mNewtext );
if( !$this->mNewRev->isCurrent() ) {
$wgOut->mParserOptions->setEditSection( $oldEditSectionSetting );
if( is_object( $this->mNewRev ) ) {
$wgOut->setRevisionId( $this->mNewRev->getId() );
}
- $wgOut->addWikiText( $this->mNewtext );
+ $wgOut->addSecondaryWikiText( $this->mNewtext );
wfProfileOut( $fname );
}
if(isset($introtitle) && $introtitle->userCanRead()) {
$rev=Revision::newFromTitle($introtitle);
if($rev) {
- $wgOut->addWikiText($rev->getText());
+ $wgOut->addSecondaryWikiText($rev->getText());
$addstandardintro=false;
}
}
function render() {
global $wgOut;
$wgOut->setArticleBodyOnly( true );
- $wgOut->addWikitext( $this->getContent() );
+ $wgOut->addSecondaryWikitext( $this->getContent() );
}
function view() {
function addPrimaryWikiText( $text, $article, $cache = true ) {
global $wgParser, $wgUser;
+ $this->mParserOptions->setTidy(true);
$parserOutput = $wgParser->parse( $text, $article->mTitle,
$this->mParserOptions, true, true, $this->mRevisionId );
-
+ $this->mParserOptions->setTidy(false);
if ( $cache && $article && $parserOutput->getCacheTime() != -1 ) {
$parserCache =& ParserCache::singleton();
$parserCache->save( $parserOutput, $article, $wgUser );
$this->addHTML( $parserOutput->getText() );
}
+ /**
+ * For anything that isn't primary text or interface message
+ */
+ function addSecondaryWikiText( $text, $linestart = true ) {
+ global $wgTitle;
+ $this->mParserOptions->setTidy(true);
+ $this->addWikiTextTitle($text, $wgTitle, $linestart);
+ $this->mParserOptions->setTidy(false);
+ }
+
+
/**
* Add the output of a QuickTemplate to the output buffer
* @param QuickTemplate $template
$text = Sanitizer::normalizeCharReferences( $text );
- if ($wgUseTidy) {
+ if ($wgUseTidy and $this->mOptions->getTidy()) {
$text = Parser::tidy($text);
}
var $mEditSection; # Create "edit section" links
var $mNumberHeadings; # Automatically number headings
var $mAllowSpecialInclusion; # Allow inclusion of special pages
+ var $mTidy; # Ask for tidy cleanup
function getUseTeX() { return $this->mUseTeX; }
function getUseDynamicDates() { return $this->mUseDynamicDates; }
function getEditSection() { return $this->mEditSection; }
function getNumberHeadings() { return $this->mNumberHeadings; }
function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; }
-
+ function getTidy() { return $this->mTidy; }
function setUseTeX( $x ) { return wfSetVar( $this->mUseTeX, $x ); }
function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); }
function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); }
function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
-
+ function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); }
function setSkin( &$x ) { $this->mSkin =& $x; }
function ParserOptions() {
$this->mEditSection = true;
$this->mNumberHeadings = $user->getOption( 'numberheadings' );
$this->mAllowSpecialInclusion = $wgAllowSpecialInclusion;
+ $this->mTidy = false;
wfProfileOut( $fname );
}
}
$in );
}
-?>
+?>
\ No newline at end of file