I'm looking for pure Ruby (or Java) solutions for beautifying HTML code.
I'm currently using Hpricot to parse HTML, since Nokogiri and other HTML parsers require external C programs. I assume that I can use Hpricot to clean up HTML if I can come up with a good algorithm. I'd prefer not to reinvent if this has already been done.