Home > Back-end >  how to make stop some end tag from visual studio code
how to make stop some end tag from visual studio code

Time:03-31

i want to save just <img scr="" alt="">

but my visual studio code save automatically <img scr="" alt="" />

I have prettier installed

No matter how hard I looked in the Visual Studio Code, I couldn't find it.

CodePudding user response:

According to Github page of Prettier, it is valid* and intended behavior

Source (GitHub Issue)

*it does comply with HTML5 standard

CodePudding user response:

Like Kaper365 said it is the intended behavior.

Also, HTML allows empty tags like <img/>, <br/>, <input/>, etc... to not have the self closing, but XHTML do not allow that.

So instead of doing like your friends, maybe would be better to get used to a style that is valid both markup languages. This way, if you get a job where the framework uses XHTML or HTML you know how to do it either way.

Stll, if you really want to remove the self closing the anwser is no, prettier doesnt do that but you can you this workaround instead: How to stop Prettier from using the old self closing tag syntax.

  • Related