Added Parser::recursivePreprocess(); like preprocess() but doesn't call startParse...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 14 Aug 2011 20:22:52 +0000 (20:22 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 14 Aug 2011 20:22:52 +0000 (20:22 +0000)
commit76478abafeed68698524281d6e9aee02ece9533d
treeb7a04f1763b2b830f24e989b4605b0525202f1e9
parentf4d0f5dfba83604af6430f8cbb02846b2d204c57
Added Parser::recursivePreprocess(); like preprocess() but doesn't call startParse() so that it can be used inside a parse operation using the same context without having to mess with other functions

Simple use case (PHP 5.3+) that will work show the expand text passed to a <preprocess> tag:
$wgHooks['ParserFirstCallInit'][] = function( $parser ) {
$parser->setHook( 'preprocess', function( $text, $attr, $parser, $frame ) {
return $parser->recursivePreprocess( $text, $frame );
} );
return true;
};
includes/parser/Parser.php