W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2002

Re: tidy mis-handles <pre> text containing <br>

From: Charles Reitzel <creitzel@rcn.com>
Date: Wed, 09 Oct 2002 17:49:25 -0400
Message-Id: <4.3.2.7.2.20021009173305.02f5bff0@pop.rcn.com>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: html-tidy@w3.org

At 05:08 PM 10/9/2002 +0200, Bjoern Hoehrmann wrote:
>I am not sure whether we should remove the <br>. It's valid to use it
>inside pre and I am not even aware of any deprecatation of this
>practise; maybe it'd be better to leave it to the user to fix it.
>Anyway, if it is replaced, it must be replaced by \n, no matter of
>preceding or following newlines in order to emulate browser behaivour.

Ok, my mistake.  Broke down and read the DTD - again.

In HTML 3.2 the following are allowed inside <PRE> elements.

TT | I | B  | U | STRIKE |
EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE
A | APPLET | BASEFONT | BR | SCRIPT | MAP
INPUT | SELECT | TEXTAREA

Yow!  Basically, %text/%inline less images and fonts.

HTML 4 is similar.


>I did not notice any problem with the tabs. What's wrong with them? Are
>they replaced by the wrong number of spaces? I remember we discussed
>this before and I proposed to change the default number of spaces. Did
>we reach consensus on that? Or is something else going wrong here?

In my test, the left-right alignment (the primary reason for using <pre>) 
was messed up.  The Pre-Tidy sample lined up nicely in both IE6 and NS6.

The input has lots of tabs and _no_ newlines. So a) I think the code is not 
adding the right number of spaces and b) any time we add a newline where 
there wasn't one before, perhaps we should take away a <br>.  Either that, 
or do not add newlines at all.

take it easy,
Charlie
Received on Wednesday, 9 October 2002 17:37:35 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:39:48 UTC