0

VS Code uses /* */ as comment marks for html.

When I use /* */ for commenting in HTML (either through a shortcut or plain typing) in a block of text I get in edges and green color on the text and the text is commented out.

When i type ">!-- --<" (< and > on opposite direction) the text does not get green.

Language mode is HTML and there are no extensions at all installed!

OAH
  • 1,160
  • 2
  • 11
  • 24
Endeka
  • 11
  • 2
  • 1
    VS Code uses /* */ as comment marks for HTML is not true – OAH May 10 '20 at 17:28
  • Does this answer your question? [Visual studio code comment in HTML files](https://stackoverflow.com/questions/37312056/visual-studio-code-comment-in-html-files) – OAH May 10 '20 at 17:28

2 Answers2

0

"" is used for strings in HTML. Strings are different from comments, as they will be actually read by the interpreter.

discape
  • 337
  • 1
  • 15
  • Sorry, I use ">!-- --<" (< and > on opposite direction), not just "". But the page renders comment marks also in the post :) – Endeka May 10 '20 at 17:10
0

Comments in HTML follow this format

<!-- comment text -->

I don't think comments work with /* comment */ in HTML.

I'm not sure why VScode seems to be suggesting that. It'd be clearer if you gave some more information, such as code snippets and what you're expecting to see.

Ash Oldershaw
  • 302
  • 2
  • 13
  • I expect when editing html to comment out using ">!-- --<" instead of /* */ VSCode use now. I use the default snippets – Endeka May 10 '20 at 17:43