Brion Vibber wrote:
The new one-pass tag stripping* is now in trunk and live on Wikimedia's sites. It passes all parser tests, and has additionally fixed bug 5384 (<!-- comments --> in <ref> tags).
- Comments are actually done on a separate pass, but unstripped back into tag
contents where they can be dealt with appropriately by the extension.
I've now folded the comments into the same pass as tags, fixing regressions with a couple funny cases. Additionally I've fixed some old buglets with the pre-save transform sometimes altering closing tags.
Note that an interesting effect of the one-pass tag stripping is that the order tags are handled in is more predictable: tag extensions are executed in the order they appear inline.
Previously if you had a document like this:
<ref>one</ref> <gallery>Image:Foo</gallery> <ref>two</ref> <references/>
the system would render first the <gallery>, second all the <ref>s, and finally the <references>.
Now, it renders the first <ref>, then the <gallery>, then the second <ref>, and finally the <references/>. This actually becomes more interesting if you want to do some legitimate nesting in tags supporting internal wikitext:
<ref>one</ref> <gallery>Image:Foo|<ref>two</ref></gallery> <ref>three</ref> <references/>
Under the new system this can actually work correctly. The embedded second <ref> gets rendered during the rendering of the <gallery>, which is between the external first and third <ref>s. Since they're executed in the expected logical order, they keep that order in the references list.
Definitely an improvement.
-- brion vibber (brion @ pobox.com)