Extension:PreviewFunctions

What can this extension do?
This extension adds a function   With the intention people could issue warnings about template usage that only appear during preview. Its inspired by how Wikipedians abuse (see discussion on 100610). It also allows as an alias for #onpreview

Additionally it adds a function   Which adds a warning to top of preview, in the same manner as how people are warned if they go over $wgExpensiveParserFunctionLimit on a page.

Download instructions
(Note the version listed for 1.19 also works for version 1.18)

Installation
Download thingy, put it in appropriate place in extensions directory, add line  to bottom of LocalSettings.php

I have tested this extension with MediaWiki 1.18, so it should work on any version of MediaWiki 1.18 or higher. I don't use any particularly new features, so it will also probably work with earlier versions (if they aren't totally ancient), but i haven't tested that at all so ymmv.

Known limitations
Tag extensions (As well as things such as &lt;nowiki&gt;) will be removed from #addpreviewwarning, and just not displayed. This could be worked around by turning #addpreviewwarning into a tag extension instead of a parser function, but a parser function seemed more suited to the type of function it is (From a what the user expects out of a parser function vs what a user expects out of a tag extension perspective).