Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer - Unexpected character in comment end warning

Internet Explorer complains about the two dashes in the url inside of a comment:

<!--
<iframe src="/file.php?var=AQJ--dsf"></iframe>
-->

HTML1416: Unexpected character in comment end. Expected "-->".

How do I get rid of this ridiculous error message?

like image 224
reggie Avatar asked Aug 10 '15 12:08

reggie


1 Answers

From the HTML 5 specification:

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 (-->).

To get rid of the error message. Stop making the error. Rewrite the part of the code with -- inside the comment.

like image 141
Quentin Avatar answered Oct 04 '22 00:10

Quentin