Big annoying bug with Gadgets extension
The problem I've mentioned on bug 28215 comment 7 reappeared, and this time I was able to find some way to reproduce it!
I've created a simple [[MediaWiki:Gadget-A.js]] with
var test = 'ok';
and then added it to [[MediaWiki:Gadgets-definition]] with "something" like this:
*A|A.js
and then nothing was displayed on [[Special:Gadgets]]. I didn't know why it didn't show up, so I've made some tests...
At some point I decided to type the "same" text again and it suddenly started to work, which I found very weird, because the diff was showing two pages with apparently the same content. Since the diffs ignore spaces and some other characteres, I decided to check exactly which characteres were in the editbox in the version of the page which didn't load the gadget. To do that, I wrote the following in the console of my browser:
var str = $('#wpTextbox1').val(); for (i=0;i<str.length;i++){ console.debug( "'" + str.charAt(i) + "'\t'" + str.charCodeAt(i) + "'" ); }
You can check the result in the attached image.
So, indeed there was some invisible character between A and |, whose char code is 8206 (what is that? how did that ended up in the page?).
So, it would be really really cool if the code of the extension could check of such strange characters in the [[MediaWiki:Gadgets-definition]] page, and either filter them out or display some warning, so that people don't need to fight against such an odd bug again.
For the record, here is the log of the first round of the fight:
https://secure.wikimedia.org/wikibooks/pt/w/index.php?title=MediaWiki:Gadgets-definition&offset=20110301000000&limit=21&action=history
(spoiler: the bug wins! =)
Attached: