illegally nested anchor tags

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, 
abovementioned]

>      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
http://www.sl-chat.de/
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:
http://www.w3.org/People/Raggett/tidy/

Received on Wednesday, 28 June 2000 03:30:55 UTC