Forum:Parser bug !

The bug is that normally it would be possible to put a   tag around almost anything. But, when i try to put a span in a li element so i can add a class to it's content, the parser close the span right away and then close the li (and it's parent ul) and put the content in a p element. Result :

   Aura de foi (Élite)&lt;/span&gt;

It should produce this :

   <a href="/wiki/Aura_de_foi" title="Aura de foi">Aura de foi</a> (<a href="/wiki/Comp%C3%A9tence_d%27%C3%A9lite" title="Compétence d'élite">Élite</a>)

This occur in the template there. It's a link to the history because it can't leave it that way, i have to find another way to code this. This template is highly used. — TulipVorlax 20 février 2008 à 03:12 (UTC)


 * I see that in the link you provided:


 * I know that the example is out of context, and that you close the span out of there, but I suspect that the parser detects that a tag isn't closed at this point, and then closes it automatically at that point. Maybe a better solution would be a <span class=""> or something lie that.
 * Other possibility is that a new line get inserted by any of the templates used in that template. --Ciencia Al Poder (talk) -WikiDex 19:45, 20 February 2008 (UTC)


 * I accept that it close the unclosed span tag. But it sould not close the li and ul elements.
 * As for the new line possibility, i'm pretty sure there was none.
 * When they saw what i could do, users asked me to add up many a others « class check ». The purpose of them is to put a border of the correct color on the image in the template. You know we can't change some property of images or links just by wrapping them in a style span, the CSS do .classname img or .classname a (and .classname a.new).
 * So now, with many #if:, there's no real problem anymore.
 * But it doesn't mean the parser behavior dont need a small lookup. — TulipVorlax 20:41, 20 February 2008 (UTC)


 * Seems ok for me --83.55.221.41 17:24, 22 February 2008 (UTC)


 * I think the real problem is that i should have rewrited the whole thing instead of starting with what had been done by others before me.
 * Yes, using the if (or the many if now) just to choose the class name like that would have been more efficient. Maybe i'll rewrite it someday. — TulipVorlax 01:40, 23 February 2008 (UTC)


 * This sounds like an idea use for #switch rather than many ifs.... — Catherine (talk) 02:29, 23 February 2008 (UTC)


 * Does the #switch: check many parameters ? It's not a parameter than can take many values but many parameters. Maybe the « master template » has been wrongly done. We could have used a single parameter with multiple possibles values. But, one day Anet (the makers of the game) could change the way things are (it happen at least two times per year) and that would mean changing the master template and all pages that use it. So we moslty use yes/no parameter (a sort of boolean) for data that could one day be yes at the same time.
 * — TulipVorlax 04:23, 23 February 2008 (UTC)
 * Ho, by the way, a guy (a frenchie) in our wiki found a way to do an OR with the IF :
 * And that is what i'm using when possible. — TulipVorlax 04:27, 23 February 2008 (UTC)
 * And that is what i'm using when possible. — TulipVorlax 04:27, 23 February 2008 (UTC)