W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2002

Re: <HR> in <PRE>

From: Richard A. O'Keefe <ok@atlas.otago.ac.nz>
Date: Thu, 24 Jan 2002 12:58:19 +1300 (NZDT)
Message-Id: <200201232358.MAA218318@atlas.otago.ac.nz>
To: html-tidy@w3.org
I asked that <HR> be turned into </PRE><HR><PRE> when it occurs
inside <PRE>.

Klaus Johannes Rusch <KlausRusch@atmedia.net> replied:
	There is a problem with this approach:
	[illegal version] and [legal version]
	are generally rendered quite differently -- pre is a block level
	element, and browsers add whitespace before/after block level elements.
The point is that <HR> is NOT ALLOWED inside <PRE> by any current HTML
specification.  It isn't legal.  Stuff like
may (in fact, DOES) render as
in some browsers, with the "bar" and "zoo" text in effect not rendered at all.
Oh, _some_ browsers treat <hr> inside <pre> as if it were
<br>"rule"<br>, but some do NOT, and I have no reason to believe that the
browsers that just do one break do the same one, or even that all browsers
do even one break.

I am requesting a change that turns *illegal* HTML into legal HTML,
doing as little violence to the rendering as possible.

By careful use of CSS, which I do not yet understand (even the book by the
inventors is terribly vague about models and details), it should be possible
to adjust the vertical spacing.

Note also that a browser would be quite within its rights to treat
	<pre>foo<!--ooh, here's a block level element, not allowed
	in a pre, I guess there's a missing /pre--></pre><hr>bar
	ugh<hr>zoo<!--heck, what's /pre doing here? I'll ignore it-->
and I know of at least one HTML parser that will in fact do this.

In short, illegal HTML can go more horribly wrong than people who want
to preserve the exact look of it can imagine.
Received on Wednesday, 23 January 2002 18:58:23 UTC

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