New Message: Re: HTML 4.01 validation in 9.6

webmaster at userland.com webmaster at userland.com
Tue Jan 3 03:22:23 CST 2006


A new message was posted:

Address: http://manila.userland.com/discuss/msgReader$1558

By: Jake Savin (jake at userland.com)

/This at least validates, but it's inserting blank paragraphs for presentational purposes, and that's not exactly what anyone wants./

Understood. The primary purpose of this fix is to reach some sort of compliance, and not so much to generate beautiful, structured HTML.

It's always going to be at least partially up to template designers and content authors who write in HTML, to understand what they need to do for their code to validate. At least the Mozilla/Firefox WYSIWYG editor is compliant. :-\

Of course it would be wonderful to have Manila figure out where paragraphs are supposed to start *and* end automatically, but it's just not feasible right now, given the current development schedule. I'm not sure it's really possible at all, without making a lot of guesses about user intent, which is in itself generally not a good idea.

/I noticed in the code for the news items that it wasn't a choice - double-returns in news items are always converted to blank paragraph tags for line spacing./

We'll address this one as well. It was actually already on the list, but thanks for pointing it out, just to be sure.

/I think it should be a choice, perhaps a new preference.../

The easiest thing to do here is to have formatNewsItem respect the value of the #autoParagraphs directive. Would that accomplish what you need in the short term?

/ It would also be very nice to have a callback at that point in anilaSuite.new.formatNewsItem - let a callback routine have the string "s" for the text of the item, process it how it wants, and hand it back to the newsitem renderer. That would at least give me a shot at solving compatibility problems with older messages .../

I wouldn't necessarily recommend this approach. Fixing all that content up while rendering requests might (at least on a busy server) end up being too CPU intensive. Instead, I suggest you write and test (thoroughly) a script to fix up the content in the legacy site(s), and run it once on the server (after backing the sites up).

200ms of CPU to fix paragraph breaks in one page may not seem like much -- and it isn't for one request at a time -- but at 50 requests/hour, that adds up to roughly a full day of 100% CPU usage during the course of a year. If there are 35 sites like this on a given server, then we're talking about almost a 10% average reduction in available CPU. It adds up pretty quick, believe me.

-Jake

This is a Manila site... http://manila.userland.com/.




More information about the Manila-Users mailing list