This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Hi, I've had this message when trying to validate a file : "Consecutive hyphens did not terminate a comment. -- is not permitted inside a comment, but e.g. - - is" with also "The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment." To reproduce, put this HTML code in "Direct input validation" in the http://validator.w3.org/ <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="fr" class="no-js"> <head> <meta charset="utf-8" /> <title>Test</title> <!-- <style> .block--element { color : #000; }</style> --> </head> <body role="document" class="home"> <!--[if lte IE 8]> <div class="block--element">blabla</div> <![endif]--> <!--<div class="block--element">blabla</div> --> </html> It will provide three times the error mentionned above. It is problematic for people that are using BEM convention in CSS and conditionnal comments (or simple comments). (note that it is not breaking display, only validation in the w3 validator) I don't know what it could imply, is it possible to fix this annoying issue ? Kind regards, Nicolas
For various complicated historical reasons, you can't put "--" in a comment. Think of it as a way to avoid accidentally putting "-->" or "--!>" in a comment (which would close the comment). I recommend using a different pattern for BEM class names. For example, instead of using "block-type__element-part" and "block-type--modifier-label", you could use something like "blockType-elementPart" and "blockType-modifierLabel", or maybe even "block-type___element-part" and "block-type_-_modifier-label".
It has over implications, not only for BEM : For example : https://twitter.com/HTeuMeuLeu/status/464348018171719680 <!--<style>--color = #000;</style>--> Won't validate. Such a shame that some sequences are forbidden in HTML comments, other than the end of a comment of course :-(