Last modified: 2011-04-14 15:12:11 UTC
At the moment some parser functions/variables output is partially escaped and partially treated as wikitext (using wfEscapeWikiText). This breaks both parsing and the use of the output of one variable as input to another, see: {{PAGENAME}} on [[*]] {{urlencode:{{PAGENAME}}}} on [[&]] The solution I propose is to add a new class of UNIQ tags to the parser. Extensions can "return $parser->armouredText( $text );" where they currently "return wfEscapeWikiText( $text )". The parser should have two replacements for each armouredText, when calling further parser functions, it replaces it with the original; when outputting, it replaces it with the escaped version (at the same time <nowiki> is re-expanded). The ugliness is that it will require several changes to allow armouredText UNIQs to be part of links/template names/magic words. A much hackier alternatively is an inclusion prefix or two (cf. msg: int: msgnw:) that could be added such that {{plain:PAGENAME}} returns the unescaped version, while {{armour:PAGENAME}} puts it into one of the existing nowiki UNIQs - but this really shouldn't be exposed to users.
Isn’t this just a duplicate of bug #12974?
Fixing this would fix some (but not all) of the problems caused by bug 12974, and vice versa, but they are not duplicates.