Nov 25, 2005
XHTML compliance
I've been trying to make this weblog XHTML compliant. For those
non-techies out there XHTML is the modern version of the HTML web
'language'. It's a dialect of XML which is .... oh nevermind. I guess
this post is for techies.
The multiple articles per day had to be revisited because it seems that '+' is not allowed in a 'name' attribute. I use named anchors on the index page. These also aren't allowed to begin with numbers. Sigh. All my articles start with numbers. Fixed that. Found a table bug thanks to the XHTML validator .
But there are still some sticky wickets and pages of non-compliance data. All of these are in the articles themselves, which were created by the editor (design) mode of the web browser - in this case Firefox. So Firefox edit mode isn't even close to XHTML compliance. It's actually some of the ugliest HTML I've ever seen. But wait - it gets worse. If you edit a page which is XHTML compliant, Firefox will gratuitously butcher it into non-compliance for you.
Which makes it particularly ironic that I wrote this weblog application primarily so I wouldn't have to type HTML in my diary any more. But if I want it to be standards compliant, I've got to dump the web editor and go back to typing (X)HTML.
For now, I'm only going to make the application itself XHTML compliant. Someday they'll fix the browser. No sense banging my head over and wasting hundreds of hours fixing somebody else's bug.
The multiple articles per day had to be revisited because it seems that '+' is not allowed in a 'name' attribute. I use named anchors on the index page. These also aren't allowed to begin with numbers. Sigh. All my articles start with numbers. Fixed that. Found a table bug thanks to the XHTML validator .
But there are still some sticky wickets and pages of non-compliance data. All of these are in the articles themselves, which were created by the editor (design) mode of the web browser - in this case Firefox. So Firefox edit mode isn't even close to XHTML compliance. It's actually some of the ugliest HTML I've ever seen. But wait - it gets worse. If you edit a page which is XHTML compliant, Firefox will gratuitously butcher it into non-compliance for you.
Which makes it particularly ironic that I wrote this weblog application primarily so I wouldn't have to type HTML in my diary any more. But if I want it to be standards compliant, I've got to dump the web editor and go back to typing (X)HTML.
For now, I'm only going to make the application itself XHTML compliant. Someday they'll fix the browser. No sense banging my head over and wasting hundreds of hours fixing somebody else's bug.
Comments:
November 25, 2005 04:46
![[*TOP MEMBER*] Keith Devens [*TOP MEMBER*] Keith Devens](images/unknown-3.jpg)
I use my markup library so that I can write my posts in StructuredText and the code generates XHTML out of it. The code's really messy, so you might want to consider something like PHP Markdown instead. Either way, it's better than typing XHTML manually.
November 25, 2005 09:33
Thanks - I had already looked at your markup lib. It's more an issue of when the browsers are going to catch up - they're the forces behind XHTML, so when will they actually produce compliant markup on their own? Oh well, I found two problematic contructs. <br> with no closing slash, and the same with <img ...>
The img tag is the glaring example because Firefox will strip the trailing slash off compliant tags and leave them naked. It's one thing to generate an old style BR tag. It's quite another for an XHTML aware browser to rewrite a new IMG tag as an old one.
As it turns out, I managed to whip up a couple of regex's to fix both of these. That will get me by until the next fiasco. I just dislike using regex's to fix browser bugs.
No votes
<lilo> "PLEASE RESPECT INTELLECTUAL RIGHTS!"
<lilo> "Please demonstrate intellect." ;)
<lilo> "Please demonstrate intellect." ;)

Digg
Delicious
Netscape
Technorati