Is there a way to make VS Code stop breaking HTML tags before > on a new line? As you can see on the picture the tag is breaking/wrapping on a next line just after the > . I'm Using Prettier - Code formatter.
Asked
Active
Viewed 826 times
0
-
Try this https://stackoverflow.com/questions/53927236/how-to-disable-prettier-settings-creating-new-line-of-of-html-tag – maltoze Jan 25 '21 at 13:25
2 Answers
0
You could try adding this line to your settings.json file
{
"html.format.wrapAttributes": "force-aligned"
}

Guillermo Brachetta
- 3,857
- 3
- 18
- 36
0
I know this is old, but for those who have the same problem, have you checked to ensure that your document is being treated as HTML rather than something else? I've seen this happen when I format my HTML code in a Javascript document.
On the bottom-right of the VS Code window, after Tab Size, UTF-8, and CRLF (your options may be different) you should see HTML. If you see Javascript, CSS, or some other code language, you'll need to click it and change it to HTML.

BevansDesign
- 4,908
- 1
- 12
- 14