Re: Tidy's handling of <noscript>

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 UTC