Last active
February 27, 2021 14:19
-
-
Save matveyt/f7412e0a4378d970ffa67cf149e2e161 to your computer and use it in GitHub Desktop.
HTML comments test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head><meta charset="utf-8"/><title>HTML 5.2 comments test</title></head> | |
<body> | |
<pre><! -- Bogus comment --></pre> | |
<! -- Bogus comment --> | |
<p>8.2.4.41-42: parser error, normal continuation after next ></p> | |
<pre><!--></pre> | |
<!--> | |
<p>8.2.4.43: parser error, normal continuation</p> | |
<pre><!---></pre> | |
<!---> | |
<p>8.2.4.44: parser error, normal continuation</p> | |
<pre><!--- Me -- is -- good -- comment ------></pre> | |
<!--- Me -- is -- good -- comment ------> | |
<p>8.2.4.51: this is all right even though validator may complain about document being | |
"not mappable to XML 1.0 due to consecutive hyphens"</p> | |
<pre><!-- Comment closed by dash-dash-bang --!></pre> | |
<!-- Comment closed by dash-dash-bang --!> | |
<p>8.2.4.52: error ignored even by parser, normal continuation</p> | |
<pre><!-- Comments cannot nest <!---> This is not a comment #1!</pre> | |
<!-- Comments cannot nest <!---> <p>This is not a comment #1!</p> | |
<pre><!-- Comments cannot nest <!----> This is not a comment #2!</pre> | |
<!-- Comments cannot nest <!----> <p>This is not a comment #2!</p> | |
<pre><!-- Comments cannot nest <!--!> This is not a comment #3!</pre> | |
<!-- Comments cannot nest <!--!> <p>This is not a comment #3!</p> | |
<pre><!-- Comments cannot nest <!---!> This is not a comment #4!</pre> | |
<!-- Comments cannot nest <!---!> <p>This is not a comment #4!</p> | |
<p>8.2.4.49: parser error, comment continues until next -->.</p> | |
<p>However the following (taken from 8.1.6) is all right:</p> | |
<pre><!--My favorite operators are > and <!--></pre> | |
<!--My favorite operators are > and <!--> | |
<pre><!--This comment was intentionally left open -- > | |
So it continues until here --></pre> | |
<!--This comment was intentionally left open -- > | |
So it continues until here --> | |
<p>But not here, of course.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment