Re: tidy without indenting?

At 16:22 +0900 13/3/01, Peter Evans wrote:
> > Can I use tidy while leaving the indents of my page as they were?
>
>No. The first paragraph under the subtitle "Layout style" within
>http://www.w3.org/People/Raggett/tidy/ explains not only that this isn't
>possible but also why it can't be an added feature.
>
>If you're desperate to preserve a laboriously contrived layout -- and I
>know I sometimes am -- then here is a (probably more laborious)
>workaround. Ignore Tidy's standard output and instead read its
>error/warning file (the file you specify after the "-f" switch), making
>your own corrections to the original file as appropriate.


	Yes, I do this too.  However, you have to watch out for a few 
things that Tidy changes without warning you about - double quote 
marks (") changed to ", apostrophes to ', and lone 
ampersands (&) to &.

	While sympathising with the original request, I think it is 
outside of Tidy's original remit, which is (as I understand it) to 
correct an HTML file so it is legal.  This necessarily entails 
disassembling it, and the corrected result can only be re-created to 
some defined standard, as indentation may HAVE to be changed to make 
the file legal.

	I think Tidy should be treated as a "first pass" engine, and 
if you want to re-edit the output to your indentation standard, then 
that is up to you.  Incremental code changes can then be re-checked, 
errors noted, and the original files corrected by hand.  As Mr.Evans 
says, this is a rather laborious approach, but once done, incremental 
changes are easier.

	Or, of course, you could learn to love the standard output 
style adopted by Tidy. :-)

	Regards,

		Peter

Received on Wednesday, 14 March 2001 13:42:10 UTC