W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 1999

Re: malformed comments

From: Rick Jelliffe <ricko@gate.sinica.edu.tw>
Date: Thu, 8 Jul 1999 12:04:37 +0800
Message-ID: <003c01bec8f6$fec53680$dd066d8c@sinica.edu.tw>
To: <html-tidy@w3.org>
 From: Bjoern Hoehrmann <derhoermi@gmx.net>

 > <!----------------->
>
> or
>
> <!-- ----------- -->
>
> The second one detected by Tidy correctly with "malformed comment", but
the
> first one isn't. I'm not sure, how the first example should be treated;
> NSGMLS reports the following:
>
> <!----------------->
>  ^  commment declaration started here
>
> So this must be some illegal use et all.

SGML rules are that "--" starts and ends a comment, inside a markup
declaration
"<!" and ">" .  So nsgmls will complain about <!-----> or <!-- -- -->
XML changed this so that comments start with "<!--" and end with "-->" to
allow more HTML documents to slip in.  So perhaps Dave could replace
the warning with some lesser one, e.g. "malformed comment (SGML syntax)".

I personally think that (and I know Charles Goldfarb who invented SGML
also thinks this) thinks that it is a good thing to have a continuum of more
strict syntaxes
    slack: HTML as implemented
    allows systematic slacknesses: SGML
    unforgiving: XML
So perhaps it would be good to parameterize the error messages with
an indication like this. For example, <p>a & b</p> is allowed in HTML
and SGML, but XML is more strict.

Tidy should follow the XML convention for parsing comments,  but I think
it should follow SGML convention for generating them: it might be
nice to have a user option to convert "-"+ sequences to "="+ sequences.

Rick Jelliffe
Received on Thursday, 8 July 1999 00:17:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:42 GMT