W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2000

Re: H3 within a link

From: Daniel Biddle <deltab@osian.net>
Date: Thu, 30 Nov 2000 10:59:28 +0000 (UTC)
To: Denis Queffeulou <denis.queffeulou@wokup.com>
cc: html-tidy@w3.org
Message-ID: <Pine.LNX.4.21.0011301046220.24707-100000@charizard.blazingfast.net>
On Thu, 30 Nov 2000, Denis Queffeulou wrote:
> I'm using JTidy as a parser, and I have a problem with the following code:
>     <a href="toto.html">
>     	<h3>blabla</h3>
>     </a>
> Tidy generates :
> <h3>blabla</h3>
> Is it a bug or is it a consequence of bad HTML writting ??

It's a consequence of bad HTML writing: <a> elements can only have inline
contents, but <h3> is block-level. When Tidy gets to the <h3> start tag, it
assumes missing </a> and </p> end tags to get back to block level, then deletes
the empty elements formed. After the heading it ignores the extra </a>.

It could also be considered a bug, as it should be obvious to Tidy that you

<h3><a href="toto.html>blabla</a></h3>
> I have search in the list something like this problem and I found "Bug:
> Nested anchor elements allowed" but the patch is in C, what about the Java
> code, especially the DescendantOf function ?

That isn't related to this.

> Thanks,
> Denis Queffeulou

hope this helps,
Daniel Biddle <deltab@osian.net>
Received on Thursday, 30 November 2000 06:00:19 UTC

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