macosx  

Re: HTML::Tidy Filter for BBEdit?

John Horner
Tue, 18 Jan 2005 03:26:16 -0800

I think HTML::Tidy doesn't offer what you're seeking: looks like it's a
validation tool, not a "pretty-print" tool. So your output is empty if things are well in the world of your html, and warnings/errors if there are problems validating the string HTML::Tidy is fed.

Well, yes and no. Perhaps it seems that way because you're seeing the HTML::Tidy documentation offering only to do those things.


But having installed the tidy library on my Mac, I can type

    tidy test.html

at the command line and have it give warnings and also print to STDOUT a fixed version of my file, e.g. it might say 'Missing attribute on line 6', and then it will print out a new version of the file with that attribute added.

The option -i will do indenting, i.e. rudimentary formatting, and the -m option will edit the file in place rather than dump the corrected version out.

So I still remain baffled by the module. Does its "clean" function transform a string in place? It doesn't seem to. Where are the options? Is it perhaps confused about where tidy is on my system (/opt/local/bin/tidy) ?
------------------------------------------------------------
"Have You Validated Your Code?"
John Horner (+612 / 02) 9333 3488
Senior Developer, ABC Online http://www.abc.net.au/
------------------------------------------------------------