This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2440 - Comments not properly handled
Summary: Comments not properly handled
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: HEAD
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-03 19:26 UTC by Edward Mulroy
Modified: 2005-11-03 19:42 UTC (History)
0 users

See Also:


Attachments

Description Edward Mulroy 2005-11-03 19:26:14 UTC
This gives an error: 

==============================
<tr>
  <td><a href="http://www.faa.gov/pilots/training/">Training</a></td>
</tr>
<!-- 
<tr>
  <td class="note" colspan="2">---Manuals---</td>
</tr>
==============================

I believe that it is incorrectly handling a comment. 


The error text is: 

==============================
Below are the results of attempting to parse this document with an SGML 
parser. 

Error Line 183 column 33: invalid comment declaration: found name character 
outside comment but inside comment declaration.
  <td class="note" colspan="2">---Manuals---</td>
 

Info Line 181 column 0: comment declaration started here.
<!-- 
Error Line 183 column 34: character data is not allowed here.
  <td class="note" colspan="2">---Manuals---</td>
You have used character data somewhere it is not permitted to appear. Mistakes 
that can cause this error include putting text directly in the body of the 
document without wrapping it in a container element (such as a 
<p>aragraph</p>) 
or forgetting to quote an attribute value (where characters such as "%" 
and "/" 
are common, but cannot appear without surrounding quotes). 

---More errors follow such as complaints about the ending </td>
==============================

The file being parsed is HTML 4.01 Transitional.
Comment 1 Terje Bless 2005-11-03 19:42:07 UTC
An SGML comment declaration is <! -- comment #1 -- -- Comment #2 -->;
it is not a typical "quoted string" that happens to be delimited by "<!--" and "-->".

IOW, never put things like "---Manuals---" inside an SGML comment; the hyphens
are significant.