I hadn't realized that there were any parsing issues around MediaWiki's markup. 5000 lines of PHP? Eek.
It's worse. The MediaWiki PHP code doesn't implement a proper scanner and parser, it's a bunch of regexes around which the code has grown more or less organically. Silent compensation for mismatched starting and ending tokens abounds, and causes problems for all consumers of the markup, in the same way that lenient HTML parsers have. The difference is that Wikipedia, as the sole channel for editing markup, could have…
Another example of the imperfect but working implementation winning.