[Mediawiki-l] parse wikitext in extension

Rowan Collins rowan.collins at gmail.com
Wed Feb 16 20:10:39 UTC 2005

On Wed, 16 Feb 2005 20:40:09 +0100, FxParlant <f-x.p at laposte.net> wrote:
> I have a fragment of wikitext in an extension, and I'm desperately
> trying to get it parsed.

I think what you absically need is: 

global $wgParser; #might not be needed
$output = $wgParser->parse( $output ); 

Although I don't guarantee that it will work right with just that one
parameter - grepping the code shows that SpecialData.php uses
something more like:

global $wgParser, $wgTitle, $wgOut; #one or more of these may be
unnecessary if the globals are already in use in the code you're
playing with
$output = $wgParser->parse( $input, $wgTitle, $wgOut->mParserOptions, true ); 
$text = $output->getText();

Rowan Collins BSc

More information about the MediaWiki-l mailing list