Hi,
I have a fragment of wikitext in an extension, and I'm desperately trying to get it parsed.
My extension works perfectly, what I just don't know is : __how to convert my wikitext to html__ ??
Can someone tell me how to do that. It must be the simplest thing but I can't find the correct class and the correct method.
EXAMPLE: *****************
$mytext= "=== MyTitle ==="; $mytext .= "some more text, with [[links]]";
$output = turn_That_To_Html($mytext); // <-- HERE IS MY PROBLEM return output; *****************
Thanks for any hint,
François
Do a search in the archives. There was a working solution provided. Use extension wikitext parsing etc. as keywords.
-----Original Message----- From: mediawiki-l-bounces@Wikimedia.org [mailto:mediawiki-l- bounces@Wikimedia.org] On Behalf Of FxParlant Sent: Wednesday, February 16, 2005 2:40 PM To: mediawiki-l@Wikimedia.org Subject: [Mediawiki-l] parse wikitext in extension
Hi,
I have a fragment of wikitext in an extension, and I'm desperately trying to get it parsed.
My extension works perfectly, what I just don't know is : __how to convert my wikitext to html__ ??
Can someone tell me how to do that. It must be the simplest thing but I can't find the correct class and the correct method.
EXAMPLE:
$mytext= "=== MyTitle ==="; $mytext .= "some more text, with [[links]]";
$output = turn_That_To_Html($mytext); // <-- HERE IS MY PROBLEM return output;
Thanks for any hint,
François
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
On Wed, 16 Feb 2005 20:40:09 +0100, FxParlant f-x.p@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();
HTH
mediawiki-l@lists.wikimedia.org