Hi, This may not be the most appropriate list, but anyway. I'll spin it into relevancy at the end :-) I was wondering what you guys are using to ensure the validity of your html output. I've been shopping around on CPAN, and found a *lot* of HTML related modules. So far I've tried the following: - HTML::Scrubber Not good enough for general use. Breaks stuff. - HTML::Detoxifier Close, but needs work. It missed the <center> tag. - Formatter::HTML::HTML A frontend to HTML::Tidy. Nice, solid. Produces almost valid HTML 4.01 Transitional. Doesn't put required attributes in when missing.The various parsers (HTML::TreeBuilder, HTML::Parser etc.) don't seem to add a doctype header, and they sure don't add missing attributes. This made me skip on HTML::Sanitizer, as it seems to be a direct subclass of HTML::TreeBuilder.
I'm currently leaning towards the Formatter one, since htmltidy is good, but I'd like to see options for consistent encoding, and missing attributes, and other doctypes. And it would be nice to be able to filter the result as well. Ideally i'd like a combination of the Formatter and the Detoxifier, with more control.
To get us back on topic: I got the idea for a plugin (just the concept for now) that sanitizes data. This is especially valuable on form input that would get redisplayed later on. But it could be used equally well in cgiapp_postrun for cleaning up your own output, ensuring standards compliance.
Something like:
my $clean = $self->clean_html($dirty);
or
$$outputref = $self->format_html($$outputref, {options});
I'd be happy to code this plugin if there's interest. But I'd like to know what your prefered html stripper/cleaner/fixer-upper is first :-)
Thanks,
Rhesa
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.