[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] OT : HTML::Tidy


Jeff MacDonald wrote:
Hi,

Does this thing actually do the Cleaning ?

Oh sure! It's very good, in my opinion: HTML::Tidy is a wrapper around libtidy.

I'm trying to update a bunch of HTML documents in a database.. my code
is like this

  my $tidy = new HTML::Tidy;
  $tidy->ignore( type=> TIDY_WARNING );
  $tidy->clean("foo.html",$newcontent) or die "!@";

clean() returns the transformed contents, so:

	$newcontent = $tidy->clean('foo', $oldcontent);

at which point, i'd like to call an update. foo.html is just a place
holder, doesn't even exist, docs say it doesn't have to.

I _think_ that file name would be used in the stringified error and warning messages you can access with $tidy->messages;

Thing is, from the man page, I can't figure out how to get at the
cleaned up content...

The docs need work. And I highly recommend you try HTML::Tidy version 1.05_02, since that gives you the option to pass a config file to the underlying library. See my plugin CGI::Application::Plugin::HtmlTidy (which relies on that 1.05_02 developer release) for some ideas, and of course see the docs to tidy itself.

HTH,

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.