Last modified: 2012-07-24 08:29:11 UTC
On the Speedrun article on wikipedia, the first unnamed external link (put in by the {{ref}} template) is listed as 3. [1] is far down on the page, in the description of an image. Currently, this article has a template for the external links section, but commenting it out with <nowiki> tags and saving does not seem to change anything.
Uhm, oops. It wasn't the templates, it was the images. The images get the first numbers for external links, even though this order sometimes makes no sense at all. Here's a more simple example, http://en.wikipedia.org/wiki/User:Michiel_Sikma/External_links_bugreport
I haven't checked out the parsing code of MediaWiki, but I presume that it's because of the use of magic tokens. The images get separated from the rest of the wikitax, get parsed, then the rest of the wikitax gets parsed, and then the two are combined into the final document before it goes to post-processing. Perhaps the descriptions of the images could be left with the rest of the document so that they can be parsed sequentially. This is only how I believe it works... I'd certainly want to check it out, but I'm not very experienced in PHP.
This looks fixed to me.