HTML Formatter for Visual Studio?
A command-line HTML pretty-printer: Making messy HTML readable - Stack Overflow
How do I modify the VS Code HTML formatter? - Stack Overflow
Announcing Rome Formatter
RomeTools was not built in a day!
More on reddit.comVideos
Hey guys, do you know any good extensions for auto-formatting html? I am getting kinda tired of doing it manually...
Have a look at the HTML Tidy Project: http://www.html-tidy.org/
The granddaddy of HTML tools, with support for modern standards.
There used to be a fork called tidy-html5 which since became the official thing. Here is its GitHub repository.
Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards.
For your needs, here is the command line to call Tidy:
tidy inputfile.html
Update 2018: The homebrew/dupes is now deprecated, tidy-html5 may be directly installed.
brew install tidy-html5
Original reply:
Tidy from OS X doesn't support HTML5. But there is experimental branch on Github which does.
To get it:
brew tap homebrew/dupes
brew install tidy --HEAD
brew untap homebrew/dupes
That's it! Have fun!
Right-click in your text editing area and choose Format Document With.... A popup will appear on top then choose Choose default formatter and then choose Prettier
You can trigger suggestions at any time by pressing
Ctrl+Space.To improve the formatting of your HTML source code, you can use the
Format Document commandCtrl+Shift+Ito format the entire file or
Format SelectionCtrl+KCtrl+Fto just format the selected text.
Read this: https://code.visualstudio.com/docs/languages/html