Re: possible bug in HTML::Parser comment handler
Bjoern Hoehrmann (derhoermi@gmx.net)
Fri, 12 Jan 2001 18:25:58 +0100
At 00:35 12.01.01 -0700, you wrote:
> >><!--
> >>td {font-family: Arial,Geneva,Helvetica,sans-serif; color: #000000;}
> >>-->
> >
> >Well, the content model of the style element is CDATA, your "comments"
> >may look like comments but they are no comments in HTML and SGML
> >terms. That's not a bug.
>
>I don't see what's wrong with that comment.
See HTML 4.01 section 6.2 on CDATA:
"Although the STYLE and SCRIPT elements use CDATA for their data model, for
these elements, CDATA must be handled differently by user agents. Markup
and entities must be treated as raw text and passed to the application as
is. The first occurrence of the character sequence "</" (end-tag open
delimiter) is treated as terminating the end of the element's content. In
valid documents, this would be the end tag for the element."
Markup like <!-- comment --> is not interpreted as "a comment" in the
style- and script-elements, so HTML::Parser would be wrong to generate a
comment event for this pseudo-comment.
--
Björn Höhrmann ^ mailto:bjoern@hoehrmann.de ^ http://www.bjoernsworld.de
am Badedeich 7 ° Telefon: +49(0)4667/981028 ° http://bjoern.hoehrmann.de
25899 Dagebüll # PGP Pub. KeyID: 0xA4357E78 # http://www.websitedev.de/