Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of html automatic formatting after saving in vscode

Shulou Source: shulou.com Published: 2022-06-03 13:24:33 11月14日 Update

This article will explain in detail how to solve the problem of automatic html formatting after saving in vscode. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

The version of vsCode has been updated in recent days, and the current version number is 1.43. In fact, every time you update the vsCode version number, you don't feel any obvious change, just update it every day. And this time vsCode really did me a "big favor".

As we all know, when we write html pages, we often bind a lot of attributes or events to elements, and it's ugly if we don't wrap them, so my daily practice is to have a separate line for each attribute, like this:

But after this update, all I have to do is save the html and automatically format it, and I move all the properties to one line, like this:

Hello World

I tolerated it at first, but I really collapsed as more and more attributes were bound to an element. I thought it was some plug-in installed, but I looked for it, and it didn't seem to be explicitly formatted for html. So I deleted all my 26 plug-ins before I got angry!

But the problem has not been solved. So I focused on the plug-ins that come with vscode. It turns out that vsCode automatically ticked me on this option after the last version update.

This is the end of this article on "how to solve the problem of automatic html formatting after saving in vscode". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Updates formatting attributes plug-ins versions questions articles lines elements all more good practical obvious irritable ugly well known events practices content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Redmi Shulou Tech Info MariaDB Huawei