John Elliot wrote:
Hi there.
I've made some modifications to MediaWiki 1.17.0 that others might be interested in. I'd be flattered if some or all of them made it into the official MediaWiki release.
Firstly, I've added links to the W3C HTML validation service hosted by MIT. These show up as 'W3C HTML 5.0' icons next to the 'Powered by MediaWiki' icon at the bottom of the page, and link the user to the HTML validation service. I've found having this feature invaluable in helping me to get my wiki text that includes HTML valid.
Theoretically, the wiki should never generate invalid HTML, but it's not perfect. You can however install Tidy to have it clean up things for you.
Unfortunately I've had to disable some features of MediaWiki in order for the validation service to pass the generated HTML. You can read about how I modified MediaWiki for W3C HTML validation at:
Interesting. We should probably try to register rel=edit, or drop it out (opinions?). EditURI is already documented at http://microformats.org/wiki/existing-rel-values#POSH_usage The W3C validator ResourceLoaderDynamicStyles was purposefully added even though it is not conforming. I think that by removing it you disabled some ResourceLoader feature.
Secondly, and more importantly I feel, I've added extended links to the 'section edit' links section. (...)
In order to support canonical section links I had to make a few changes to the settings files, and update the linker, etc.,
You could have also just used the hook.
Anyway, that's it. Thought some of you might like to know. If you like the ideas but don't like the implementation, then please feel free to BYO implementation. Mine's a little bit less than perfect owing to no i18n support and me not knowing the best file to put my functions in. So, I'd be happy if someone else gave my code a spruce up.
Thanks!
John.
Thanks for sharing!
I did a fast review of it below: You have an html injection problem in the extended links. 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. 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)
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).