Forum:Syntax correction

Hi, can you tell me if there is some errors in this code?

I'll explain what I want to do: when I get a DPL output list, the link to the current page is rendered as normal link, while normally the wiki syntax convert it in bold plain text. I want to correct it. (the links are in a element with class ).


 * I came up with a code that will work for that. However, I don't know much about JavaScript, so someone else may be able to tell you a better solution.


 * --Gardimuer { ʈalk } 18:47, May 4, 2012 (UTC)


 * I'm sorry but that doesn't work...

Ok, I noticed that it doesn't work for certain pages, I'm using this code:

which works, but for some articles with symbols it doesn't. An example would be "Sant'Urea" which is rendered as. How can I fix that?


 * I see what the problem is. The DPL is replacing special characters in the link urls, such that Sant'Urea becomes Sant%27Urea. You were on the right track with trying to convert the wgPageName variable into URL code. Unfortunately, the DPL doesn't seem to be following the normal URL encoding rules. As far as I can tell, trying to match the href attribute might require code to replace individual characters in wgPageName.
 * An alternative would be to try matching the title attribute instead, like so:


 * --Gardimuer { ʈalk } 22:45, May 4, 2012 (UTC)


 * Good idea, I'll go with that. Thanks.