[Seaside] [BUG] in IAHtmlParser

Avi Bryant avi@beta4.com
Thu, 28 Mar 2002 16:23:44 -0800 (PST)


On Fri, 29 Mar 2002, Alain Fischer wrote:

> Hi Avi,
>
> I have tried to inspect or explore each of the following line:
>
> IAHtmlParser parse: '<span><table></table></span>'
> IAHtmlParser parse: '<table><tr></tr></table>'

According to the HTML 4.0 spec, <span> can only contain inline tags, and
so having a <table> inside a <span> is not legal (<div> is the equivalent
intended to contain block tags like <table>).  This forces the <span> to
close before the <table> tag.

The HTML parser Julian wrote for Seaside is pretty strictly conformant -
this lets it be smart about not requiring close tags everywhere, but it
does mean that it can do somewhat surprising things with illegal markup.
One way it could be improved would be to actually throw an error when a
tag (like span) that requires a close tag doesn't get one (or, as in this
case, apparently doesn't).

I imagine this cost you some time, and I apologize - if you stick to
conformant HTML4, you should be ok in the future.

Avi