W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2000

illegally nested anchor tags

From: Sebastian Lange <lange@cyperfection.de>
Date: Wed, 28 Jun 2000 09:27:47 +0200
Message-Id: <>
To: HTML Tidy List <html-tidy@w3.org>
Hello Dave!

Apparently, Tidy leaves following piece of code untouched, even though it 
is not legal HTML (<!ELEMENT A - - (%inline;)* -(A)       -- anchor -->):

        <A HREF="/">test <A NAME="test">name</A></A>
      Error: document type does not allow element "A" here

Originally, I found this problem while validating Tidy-generated output 
(with [http://validator.w3.org/]), unfortunately I have no way to 
reconstruct the original input that caused Tidy to cause this Error.

Notice: while the above example is simply untouched by tidy, in the below 
case, tidy produced something like "<A><A></A>", which totally surprised 
me. I am still trying to get ahold of a copy of the original input, but 
chances are that this remains a mystery.
Of course, this might also be related to my after-tidy parsing - but I only 
remove illegal attributes or empty <FONT></FONT> pairs...
The insertion of a single <A> into an <A></A> pair is mysterious to me.

>      Line 307, column 116:
>        ... u/~Scott_Moore/texts/Marx_Opium.html">Click here<A></A>
>                                                              ^
>      Error: document type does not allow element "A" here

[the following errors (a whole page full) are resulting from the first, 

>      Line 308, column 2:
>        <P><BR></P>
>          ^
>      Error: document type does not allow element "P" here; missing one of 
> "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag
>      Line 309, column 3:
>        <HR>
>           ^

Sebastian Lange
Maybe the first chat site that validates as HTML
4.0 even though user input may contain HTML codes.

Courtesy to Dave Raggett's HTML Tidy:
Received on Wednesday, 28 June 2000 03:30:55 UTC

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