Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wanted: Command line HTML5 beautifier [closed]

Wanted

A command line HTML5 beautifier running under Linux.

Input

Garbled, ugly HTML5 code. Possibly the result of multiple templates. You don't love it, it doesn't love you.

Output

Pure beauty. The code is nicely indented, has enough line breaks, cares for it's whitespace. Rather than viewing it in a webbrowser, you would like to display the code on your website directly.

Suspects

  • tidy does too much (heck, it alters my doctype!), and it doesn't work well with HTML5. Maybe there is a way to make it cooperate and not alter anything?
  • vim does too little. It only indents. I want the program to add and remove line breaks, and to play with the whitespace inside of tags.

DEAD OR ALIVE!

like image 304
blinry Avatar asked Apr 17 '10 07:04

blinry


People also ask

What is HTML beautifier?

HTML Beautifier/formatter is an online Tool to easily beautify your HTML code. Paste any minified codes or unindented codes and you'll get the beautified or formatted output.

How do I prettify HTML code?

To improve the formatting of your HTML source code, you can use the Format Document command Ctrl+Shift+I to format the entire file or Format Selection Ctrl+K Ctrl+F to just format the selected text.


1 Answers

HTML Tidy has been forked by the w3c and now has support for HTML5 validation.

https://github.com/w3c/tidy-html5

like image 72
mhansen Avatar answered Oct 14 '22 02:10

mhansen