$wgTidyOpts = '';
$wgTidyInternal = extension_loaded( 'tidy' );
+/**
+ * Put tidy warnings in HTML comments
+ * Only works for internal tidy.
+ */
+$wgDebugTidy = false;
+
/** See list of skins and their symbolic names in languages/Language.php */
$wgDefaultSkin = 'monobook';
* @static
*/
function internalTidy( $text ) {
- global $wgTidyConf, $IP;
+ global $wgTidyConf, $IP, $wgDebugTidy;
$fname = 'Parser::internalTidy';
wfProfileIn( $fname );
} else {
$cleansource = tidy_get_output( $tidy );
}
+ if ( $wgDebugTidy && $tidy->getStatus() > 0 ) {
+ $cleansource .= "<!--\nTidy reports:\n" .
+ str_replace( '-->', '-->', $tidy->errorBuffer ) .
+ "\n-->";
+ }
+
wfProfileOut( $fname );
return $cleansource;
}
$curIndex++;
}
if ( $mode == 'replace' ) {
- $outText .= $frame->expand( $node );
+ $outText .= $frame->expand( $node, 0, PPFrame::RECOVER_ORIG );
}
$node = $node->nextSibling;
}
}
}
if ( $mode == 'get' ) {
- $outText .= $frame->expand( $node );
+ $outText .= $frame->expand( $node, 0, PPFrame::RECOVER_ORIG );
}
$node = $node->nextSibling;
} while ( $node );
// stripped by the editor, so we need both newlines to restore the paragraph gap
$outText .= $newText . "\n\n";
while ( $node ) {
- $outText .= $frame->expand( $node );
+ $outText .= $frame->expand( $node, 0, PPFrame::RECOVER_ORIG );
$node = $node->nextSibling;
}
}
const NO_ARGS = 1;
const NO_TEMPLATES = 2;
+ const RECOVER_ORIG = 3;
/**
* Construct a new preprocessor frame.