Re: <!-- comments -->

Daniel W. Connolly (
Fri, 20 Jan 95 19:18:22 EST

In message <ab45f40e16021004984b@[]>, Tom Magliery writes:
>Forgive me for injecting a 2.0 question into the morass... Consider the
>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.


This little perl ditty will test for proper comment syntax:

if( /<!(--([^-]|(-[^-]))*--\s*)*>/){
print "Yes.\n";
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.