comment-divider icon indicating copy to clipboard operation
comment-divider copied to clipboard

incorrect comment style when commenting in js <script> in html page

Open GorvGoyl opened this issue 5 years ago • 1 comments

I guess extension comment style depends on page extension. So, when I comment some js code which is included in the html page, the extension gives the html style comment which is wrong.

index.html

<script>
<!-- ---------------------------- example line ----------------------------- -->
function hello(){
}
</script>

However, VSCode is commenting fine so see if that can help.

GorvGoyl avatar Mar 30 '20 10:03 GorvGoyl

Found a similar bug. VSCode automatically detects when you're writing HTML in a .php file, but the extension uses PHP comments instead of HTML comments.

for example

<?php if($var): ?>
  /* ----------------------------- example line ----------------------------- */
  <div>
    <p>example</p>
  </div>

<!-- VSCode generated comment -->

<?php endif; ?>

RasyadiAbdoellah avatar Jul 13 '21 06:07 RasyadiAbdoellah