On 10/08/2011 6:43 AM, Platonides wrote:
Theoretically, the wiki should never generate invalid HTML, but it's not perfect.
It was pretty close to perfect. I only had to comment out two features to get conformance with the (experimental) HTML5 validator. I assumed HTML5 output in my code, although AIUI MediaWiki also supports other varieties of HTML.
You could have also just used the hook.
Ah, but I don't know how to use the hook (yet), do I? :P I'll figure it out and fix up my code.
Thanks for sharing!
No worries.
I did a fast review of it below: You have an html injection problem in the extended links.
OK, I'll look into that.
What I don't understand is why you worked so hard to make the extended link use the canonical domain. A relative link would have worked fine.
Yeah, I have relative links if the canonical domain features aren't specified. (I added that as an after-thought, and you might have reviewed my code before I'd posted the update.)
Also, all the $wgCanonical* pieces could have been replaced with setting $wgServer to the chosen domain and a few calls to getFullUrl. (if $wgCanonicalSecureHost != $wgCanonicalHost, $wgServer can be set conditionally)
Ah, I didn't know about $wgServer.
Finally, if you wanted to mark one of them as canonical, IMHO you should have added a<link rel="canonical"> (but be careful with redirects, when MediaWiki adds one itself).
I don't know anything about <link rel="canonical">, nor do I really know how/where to go about adding it. Maybe I'll look into that.
Thanks.
John.