QINU fix

Some extensions that parse WikiMarkup return strings similar to "UNIQ7dcd9aca33200a81-example-14c1dc322856b22b00000001-QINU" instead of returning what they're supposed to. This seems to be a bug with using  to access the parser. In MediaWiki 1.6.8 or above, the parser object is passed to the extension callback function. By using that object, you can solve the problem.

For example, this code may break (it seems inconsistent, or at least in my tests)

The following  function fixes the problem in most cases:

The above code will add  around your output. To disable this, just change the second to last line to:

However, this won't work with newer versions of MediaWiki (1.6.7?) if you call it more than once. Instead, instantiate a new parser altogether:

I haven't tested this with the backward-compatibility described on MediaWiki extensions FAQ, but it seems like it should work.

In general, it seems like a better idea to use the $parser than the global $wgOut object.