W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2001

Re: Empty paragraphs

From: Lee Passey <lee@novonyx.com>
Date: Tue, 04 Sep 2001 10:44:47 -0600
Message-ID: <3B9504FF.79681479@novonyx.com>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
CC: html-tidy@w3.org

Bjoern Hoehrmann wrote:
> * Lee Passey wrote:
> >The default behavior of Tidy is to replace <p></p> with <br />.
> Is it? It trims the empty paragraph, it doesn't replace it, not 04
> August release nor current CVS version.

You're right.  I was confused because I had changed the default for
DropEmptyParas to no for my testing.  The behavior I was describing
occurs when you set the parameter to no in your config file.

> >I have some html files which contain the phrase <p>&nbsp;<p>, and I
> >expected that same behavior would hold for them.  This is not the case.
> Why should it?

"Should" is a religious question, which I tend to avoid whenever
possible; I leave to wiser heads than mine the question of whether or
not <p>&nbsp;</p> "should" be treated differently than <p> </p>.  I
simply stated that I _expected_ them to be treated the same, and for my
particular application I _want_ them to be treated the same.  As I have
already fixed my copy of the code the question is not relevant for me. 
On the other hand, if others desire the same behavior as I do, I have
provided the fix.

> There were some bugs in the relevant passages, but without a small test
> case, that demonstrates the problem, it's hard to figure out what went
> wrong here and whether it was already fixed, so please provide such a
> test case, thanks.

Attached.  You will note that the file contains 3 cases:

<p>  </p>

Assuming the default configuration (DropEmptyParas == yes), in the first
case the line is returned unchanged, in the second case the spaces are
trimmed, but the tags are returned (resulting in an empty paragraph on
output), and in the third case the line is dropped from the output.  I
would expect the same behavior in all three cases.  What is the
rationale for three different treatments, if that is in fact what is

> --
> Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
> am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
> 25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/
Received on Tuesday, 4 September 2001 12:42:33 UTC

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