To shed some light on what's going on. As you probably know, HTML originates from SGML. In SGML they could write something like that:
<!ELEMENT some serious stuff
Some stupid comments
that can even spread across multiple lines
more serious stuff
-- More stupid comments --
BTW. Note there's no space between
ELEMENT, but there can be space(s) between last
However, in HTML there were only few "true" SGML entities, such as
<!DOCTYPE ...>. And so HTML comments were like extra empty SGML entities:
<!-- This is SGML/HTML comment --
-- Yet another SGML/HTML comment --
This is how HTML2 (RFC 1866) defined the comments. And also how Vim syntax file parsed them. So it was very sensitive to the number of consecutive dashes.
In HTML3 they removed "multiple comments" feature, and simply said "the comment is anything between
But later they added "should avoid consecutive dashes inside comments". And after that even "must avoid". And so on from HTML4 down to HTML5.
And only in HTML 5.2 we've got very elaborated and formalized syntax for comments of its own.
So what I implemented is that new HTML 5.2 syntax. One can say that its main features (a) consecutive dashes are ok; (b) no space between
>. But in fact there's more than that.
While working on new syntax for Vim, I wrote HTML file to test for corner cases. Now, it displays well in browser, and also validator complains only where it's supposed to, but syntax highlighters seem to choke on it. I even wonder if there's any HTML syntax highlighter (except browser built-in, or Vim ;-) to pass this HTML 5.2 test?
But anyone who wants to play safe should avoid all this stuff and write only simple comments:
<!-- Text without consecutive dashes -->.