Re: <!-- comments -->

Daniel W. Connolly (connolly@hal.com)
Fri, 20 Jan 95 19:18:22 EST

In message <ab45f40e16021004984b@[141.142.103.218]>, Tom Magliery writes:
>Forgive me for injecting a 2.0 question into the morass... Consider the
>following:
>
><!------------------------------------------------------------>
>
>My left brain (or is it my right brain?) does not want this to be a valid
>comment, but I can not dispute it wielding the HTML 2.0 spec. Who wins?
>Brain or spec?

We had this discussion before.

See:
http://www.acl.lanl.gov/HTML_WG/html-wg.messages/272.html

This little perl ditty will test for proper comment syntax:

=========
while(<>){
if( /<!(--([^-]|(-[^-]))*--\s*)*>/){
print "Yes.\n";
}else{
print "no.\n";
}
}
=========

According to that, and to the validation service, and to ISO8879, and
hence according to the HTML 2.0 spec, yes, that's a legal comment.

(but be careful with the number of -'s! One more or one less, and
it's not a legal comment any more!)

If you limited your support to
<!-- anything but two -'s -->

I'm sure nobody would complain too loudly.

But I think it would only take about 30 minutes of head-scratching to
go ahead and implement the full syntax, and then you'd never have
to worry about it again.

Dan