The way the <nowiki> tag is currently implemented, any text inside the tag is basically stripped out, held to one side, and reinserted at the last minute. So this:
1: [[pipe.jpg|thumb|A <nowiki>|</nowiki> character]]
works because that stage of the parser never even sees the | character, and it reappears magically after the text has been turned into <div...><img...></div> (I think).
However, what it actually does in a given context is actually hard to pin down. This doesn't work, for example:
2: [[Image:<nowiki>foo</nowiki>.jpg]] - the whole thing is rendered literally.
I was thinking perhaps it could be redefined thus:
"Text surrounded by a <nowiki> block is treated as a literal sequence of characters with no special meaning ascribed to any character other than its literal representation. A nowiki block is a token separator, not whitespace."
That would mean example 2 above would render as if the nowiki tags weren't there.
This would also work:
3: [[Image:foo.jpg|thumb|<nowiki>left</nowiki>]] (caption: "left")
This would be a tricky case:
4: <nowiki> <script badeviljavacode here> </nowiki>
This would render literally, because of the "token separator" aspect:
5: [<nowiki></nowiki>[not a link]].
It would be technically possible to link to pages with bad characters in their names:
6: [[E<nowiki>|</nowiki>eet]]
Would any existing wikitext be broken by this redefinition? I'm not really trying to change the meaning of nowiki, I'm trying to set it down in words, given that the existing definition ("stuff gets stripped out, then replaced at various times") is not really implementable.
Steve