W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2009

Re: Is it possible to preserve extra line breaks when using [input-xml: yes] [indent: yes]

From: Lee Passey <lee@novomail.net>
Date: Tue, 28 Apr 2009 11:50:54 -0600
Message-ID: <49F741FE.8070802@novomail.net>
To: Robert Parks <robertjparks@gmail.com>
CC: html-tidy@w3.org
Arnaud Desitter wrote:

> Hi,
> Tidy re-formats its input and discards any incoming line breaks.
> Therefore, it does not do what you want.

If I may, I would like to amplify on M. Dessitter's comments.

One of the earliest requirements for web browsers was that they must not 
fail catastrophically; that is, if the web document that was delivered 
to them contained errors, they must guess at to what presentation was 
originally desired and must not simply display an error.

One of the consequences of this requirement was that a lot of really 
bad, non-conformant HTML was written, because usually the web browsers 
of the day could deal with it.

The goal of Tidy was, and is, to take that really bad HTML and fix it. 
The way to fix bad HTML is not always clear, and in some of these cases 
Tidy issues a warning to the effect of "I fixed it this way, but it may 
not be what you want." In other cases the HTML is so bad that Tidy can't 
even make a good guess, so it issues an error telling the user that some 
specific markup has to be fixed by hand.

It is not, and never has been, the goal of Tidy to take good HTML and 
simply reformat it. Of course, there are "pretty print" routines as part 
of Tidy because once an HTML document has been fixed it needs to be 
output in a reasonable form. But reformatting an HTML document is a 
side-effect of the repair action, and not a goal in and of itself.

I'm sure there are a number of applications whose primary function is to 
re-format or "pretty print" an HTML document. Mr. Parks identifies 
Visual Studio as one of those applications. This is not, however, Tidy's 
function. If "pretty printing" is the desired behavior, with detailed 
control over the output, some application other than Tidy should be used.
Received on Tuesday, 28 April 2009 17:53:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:57 UTC