Rendering wikitext is not a problem:
function renderHideShow( $input ) { global $wgParser, $wgUser, $wgTitle; $parserOptions = ParserOptions::newFromUser( $wgUser ); $parser = & new Parser(); $output = & $parser->parse($input, $wgTitle, $parserOptions);
Now $output->getText(); has properly rendered wikitext.
So if I have: <hideshow>Here's some [[wikitext]]</hideshow>
the [[wikitext]] will be properly rendered as a link.
However, even though I sent the $input through the parser, AND the first parsing function called in that routine is:
$text = $this->strip( $text, $this->mStripState );
which contains the foreach to render extensions, there's something that isn't quite setup properly in the parser - because the foreach never executes when extension tags are included in $input.
So if $input is "Here's some [[wikitext]] and another <ext>extension</ext>", then [[wikitext]] gets rendered, but <ext> does not.
Maybe its a bug...
- MHart
----- Original Message ----- From: "Rowan Collins" rowan.collins@gmail.com To: "Wikimedia developers" wikitech-l@wikimedia.org Sent: Tuesday, June 14, 2005 12:45 PM Subject: Re: [Wikitech-l] Cascading extensions
On 14/06/05, MHart wiki@matthart.com wrote:
Extensions within extensions don't seem to be parsing.
Extensions return HTML, not wikitext; that is, nothing returned by your extension function will be touched by the parser. In the case of "<e1><e2>foo</e2></e1>" only the extension for "e1" will be called, the rest is just its input, and its output is just HTML.
For how to manually parse some text inside the extension, see http://meta.wikimedia.org/wiki/MediaWiki_extensions_FAQ#How_do_I_render_wiki...
For something more specific, you'll have to improvise.