I'm having trouble commenting out sections of HTML in cases where the sections already have comments. This is because the closing tags of the comment syntax conflict. Is there any VS Code Extension that could ease my difficulty?
1 Answers
As far as I know, there is no extension, because the HTML syntax (or SGML) does not allow it.
As a workaround that should be used in exceptional cases only (you are warned due to expected errors in manual processing), you can use the following:
<head>
<title>Garden</title>
<!-- this is some comment
<!- - this is some inner comment - ->
<!- - this is some sibling comment - ->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="garden, home, plant">
<meta name="MS-HKWD" content="tree">
<meta name="MS-HKWD" content="pond">
<meta name="MS-HKWD" content="fish">
<meta name="MS-HKWD" content="flowers">
<meta name="MS-HKWD" content="health">
<meta name="MS-HKWD" content="health, relax">
<meta name="MS-HAID" content="botany">
this is the footer of comment -->
<link href="../design.css" rel="stylesheet" type="text/css" />
</head>
Or you may want to use a special character and something like this:
<!~~ this is some inner comment ~~>
- 2,159