HTML comments within comments?

Viewed 27421

Is there a way to comment multiple lines... which already have some comments in them?

i.e.

<html>
<!-- Multi-line comment begin
  <head>
    <!-- This script does abcxyz -->
    <script>...</script>
  </head>
  <body>
    Hello world!
  </body>
Multi-line comment end -->
</html>

It seems that even SO's syntax hilighting won't accept this...

7 Answers

it may still be useful for some developers, if use use vsCode as your IDE you can use an extension named Nest Comments in visual studio code market which work like a charm.

this is the link Nest Comments

One can embed it in single or double quotes as a tag attribute. This requires then of course that the corresponding quotes are not occurring in between.

<html>
<br comm='Multi-line comment begin
  <head>
    <!-- This script does abcxyz -->
    <script>...</script>
  </head>
  <body>
    Hello world!
  </body>
Multi-line comment end'>
</html>

http://jsfiddle.net/cehfumb2/2/

Related