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

Re: Tidy's handling of <noscript>

From: Klaus Johannes Rusch <KlausRusch@atmedia.net>
Date: Mon, 20 Aug 2001 19:06:30 CET
Message-Id: <200108202214.SAA02823@tux.w3.org>
To: <html-tidy@w3.org>
In <200108201344.JAA14659@nic.com>, Valen <valen@nic.com> writes:
> It is not my intent to disparage Tidy; it is truly a swell piece of work.  I am simply inquiring about a particular
> behavior.  I guess I had in mind an alternate approach.  It's appropriate that <noscript> or any other element that
> ought not occur in <head> be placed in <body>. But why should the head-licit <script> tag suffer the same fate? To put it differently, why not
> process all <head> tags, moving to <body> those that are illicit while leaving in place those that are
> licit?

The <noscript> tag following a <head> tag is not _illegal_ in HTML, the 
<noscript> tag in <head> context is. Since the DTD allows <noscript> in the
context of <body> but not <head>, tidy rightly assumes that the <head> section
has ended (with an implied </head>) and the <body> section has started (with an
implied <body> tag), so all following elements are interpreted in the context
of <body>.

If all input documents were wellformed and no tags were implied, then tidy 
could move elements to another section, with the HTML DTD not requiring 
wellformedness and allowing for implied tags, there is no way tidy can "guess" 
the right context.

-- 
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
Received on Monday, 20 August 2001 18:14:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:46 GMT