[Mediawiki-l] Using the parser inside an extension

Jim Wilson wilson.jim.r at gmail.com
Sat May 19 02:30:56 UTC 2007


I think you're looking for $parser->parse()

An instance of the Parser class (which is usually, but not always the same
as $wgParser) is passed as a parameter to functions that act as extension
tags.  Make sure your function expects this argument - third if I remember
correctly.

It's probably a good idea to have a look at some other Parser Extensions to
get an idea of what I'm getting at:

http://www.mediawiki.org/wiki/Category:Parser_extensions

Good luck!

-- Jim R. Wilson (jimbojw)

On 5/18/07, Ev. Jugend im Kirchenkreis Bleckede - Website <
admin at ej-bleckede.de> wrote:
>
> Hi,
>
> in my custom extension there's $output, which holds some text, some wiki
> markup and some HTML. To parse it all with the MediaWiki parser, I have
> been
> using the following code at the end of the render* function:
>
> return $wgOut->parse($output);
>
> This does not seem to work on 1.10.0, upgraded from 1.5.8. "return
> $output;"
> works, but is, naturally, not parsed. "return $wgOut->parse('test');"
> results in much the same error as the line above, which leaves me thinking
> that maybe there's a new way to do this.
>
> By the way, the apparent output of that function is
> "UNIQb9c8c6d6f93b17c-extgallery-00000001-QINU". "extgallery" is the name
> of
> my extension. I understand this output is something related to PHP and
> memory management, but I could be wrong.
>
> Any ideas?
>
> Thanks,
>
> Julian
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


More information about the MediaWiki-l mailing list