The kitten on the keyboard of Eur Ing Chris Green resulted in::
I'm trying to understand and unpick an HTML template file, an automatic 'beautifier' would help no end, are there any out there?
Hi, I have to deal with this at work. The tools I use, well, there's tidy which seems ok, but a bit primitive, not sure how recent the html can be. Should be available in most distros.
There's a perl script knocking around called hindent that's ok, but fragile. I.E. if there's things like closing tags without opening, or quotes closed with single quotes and that manner of vileness, it will barf, and not help much in fixing the html. So if the code's been machine generated, it's worth a shot.
I generally edit using VIM, and there's a very good html mode available. Things like bracket matching, "%: getting overloaded to zip from opening to closing tags, command-sequences for pasting in more complex tagging (;ta puts in a pair of table tags, with the cursor in the middle). I feel unclean for saying this ;-) but there's just *got* to be something similar for emacs!
However, about once a week, I get a website through that's been "outsourced" to a sweatshop in India. The code is, erm, interesting. (Using a table for layout is bad? Ha! These get nested 7 deep!!! Auto-generated from PhotoShop, at a guess.) The best tool I've found for dealing with this, buy far, is, unfortunately, Windows shareware, "CSE HTML Validator" Very, very good. But once the code's fixed, back to VIM I go!
Best of Luck! Bill