[TxMt] Weird HTML Comment Issue?

Allan Odgaard throw-away-1 at macromates.com
Sat May 6 03:16:22 UTC 2006


On 6/5/2006, at 4:55, Eric Coleman wrote:

> I've noticed that the HTML comments are slightly restrictive.

Indeed they are :)

> If I have the following code: [...] <!--- order now ---> [...] it  
> will highlight everything from the start of the comment, to the end  
> of the page.  How do I fix that without going through all the flies  
> to fix the comments?

 From the HTML standard chapter 3.2.4:

    [...] A common error is to include a string of
    hyphens ("---") within a comment. Authors should
    avoid putting two or more adjacent hyphens inside
    comments.

So I would suggest fixing your comments (search’n’replace). While the  
HTML standard doesn’t explicitly say it (anymore, I think it did in  
the past), HTML comments come from SGML, and here ‘--’ changes state  
in the parser. So your last ‘--->’ is (if this was a strict parser)  
seen as ‘--’, which goes into a mode where it expects whitespace or a  
‘>’ (to terminate the comment), but instead it finds another dash (‘-’).





More information about the textmate mailing list