Re: malformed comment report

On 17 Nov 2017, at 15:43, Andrew Teal wrote:

> I added  correct comment tags, <!-- /comment/ -->, to a section of an 
> existing document, which unfortunately contained double hyphens: -- 
> (nb no <! or >)
>
> The validator complained, until I took out one of the hyphens.
>
> It needs to look for the whole tag!


See [the specification][1]:

Comments must start with the four character sequence U+003C LESS-THAN 
SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS 
(<!--). Following this sequence, the comment may have text, with the 
**additional restriction** that the text must not start with a single 
">" (U+003E) character, nor start with a U+002D HYPHEN-MINUS character 
(-) followed by a ">" (U+003E) character, **nor contain two consecutive 
U+002D HYPHEN-MINUS characters (—)**, nor end with a U+002D 
HYPHEN-MINUS character (-). Finally, the comment must be ended by the 
three character sequence U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, 
U+003E GREATER-THAN SIGN (-->).

The validator is correct to report the error.

[1]: https://www.w3.org/TR/html5/syntax.html#comments

Received on Monday, 20 November 2017 11:38:10 UTC