Closed Bug 249913 Opened 20 years ago Closed 20 years ago

Code treated as comment when the text contains hyphens - Page doesn't display correctly

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mail, Assigned: bugzilla)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Build Identifier: 0.9.1

I have a website that had a comment at the beginning of my server side include 
that looked like this:
<!-- ---------- BEGIN SERVER SIDE INCLUDE ---------------- -->
The browser treated everything as comments from this point until it reached 
the following comment:
<!-- ---------- END SERVER SIDE INCLUDE ------------------ -->
There were other comments between these two comments such as:
<!-- Begin Navigation Table  1 Rows 1 Columns -->
These comments did not cause the recognition of the end of the comment block.
When I changed the initial and end comment lines to the following, the code 
was no longer treated as a comment:
<!-- *********** BEGIN SERVER SIDE INCLUDE *********************** -->
<!-- *********** END SERVER SIDE INCLUDE ************************* -->

The comments with the hyphens work in Internet Explorer but not Firefox or 
Mozilla.  They only would work by changing the hyphens to asterisks 

Reproducible: Always
Steps to Reproduce:
1. Add comment lines around a block of HTML with embedded hyphens as part of 
the text as I illustrated in the Details section.
2. Display the page in a browser.
3. Look at the result in the DOM Inspector

Actual Results:  
The code between the comments is treated as one large comment block when it 
shouldn't be.

Expected Results:  
It should have recognized the end of comment marker --> at the end of the line 
and displayed the page with the HTML not treated as a comment.
This is correct behavior.  -- marks the beginning/end of a comment and so is not
permitted within the comment.

See http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
(In reply to comment #1)
> This is correct behavior.  -- marks the beginning/end of a comment and so is 
not
> permitted within the comment.
> See http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML

Thanks!  I was using a bad practice based upon Internet Explorer accepting 
this as valid.
You need to log in before you can comment on or make changes to this bug.