Extension:Negref

The Negref provides a #negref parser function with the ability to negotiate the location of  tags within a chunk of WikiText. This parser function is primarily useful on semantic wiki, especially those using Semantic Forms, though it can also be very useful to a wiki that uses a lot of infobox like templates and likes to keep template parameters clean and simple.

Negref solves the problem of having template parameters you want to turn into some sort of link or semantic property but where the value may contain a tag. Instead of being forced to drop the ref tag, put it in another template parameter, or force people to hardcode the complex wikitext in articles the #negref parser function allows you to take a template parameter's value, and separate the ref tag from the rest of the value.

Usage
The first parameter to the negref parser function is the wikitext you want to negotiate the location of the ref tags inside. The next two parameters are replacement tokens for the data, and the ref tags, something like $s$ and $ref$ work, these tokens will be used with the following pattern. The final parameter is the pattern you want to put the data and the ref tags from the wikitext into. For example if your goal was to create a link from the data of a template parameter and you were trying to keep the ref tags outside of that link to prevent them from breaking the link you would use. Now if  contained something like   the result would be. The value here beind that if you had instead used  the result would have been   which of course would have broke the link.

Installation

 * 1) Download a snapshot and extract it to your extensions directory.  Choose the version that matches your version of MediaWiki.
 * 2) Add   to the bottom of LocalSettings.php.
 * 3) Installation can now be verified through Special:Version of your wiki.