If possible, I always like to create my html with HTML 4.01 STRICT doctypes.
Why? Mainly because it avoids the issues around ’certain browsers’ not being able to correctly interpret XHTML when sent as type application/xhtml+xml. I can’t see any real advantage to using XHTML over HTML anyways - its only relevant if you intend your web pages to be parsed by some other xml reading app.. anyway, I digress, and I’m not here to start any arguments.
I’d like to collate here any tips that people have for making MODx Evolution, plus any snippets/plug-ins you use, output completely valid HTML. Currently I’m using MODx Evo 1.0.2 on sites I’m building.
TinyMCE plugin
If editors use TinyMCE, and insert line break tags, they come out as [tt]
[/tt] because TinyMCE assumes you want XHTML. To change this into non-self-closing tags, simply modify your config script as seen here:
http://modxcms.com/forums/index.php?topic=30013.0 and TinyMCE will output HTML.
eForm snippet
eForm also assumes you want self-closing tag format, so inserts [tt]
[/tt] and [tt]<input />[/tt] tags ahoy. The simplest way to do this is to modify the eForm core snippet file at /assets/snippets/eform/eform.inc.php and go through and modify all the tag outputs.
You could, I suppose, write a plug-in to do all of these sorts of things for you, checking the document for self-closing tags and replacing them with their implicit version, before output. Maybe someone has already done so?
Anyway, I’d be keen to hear if anyone else has any tips or ideas to share on this!