News for hackers. Stuff that matters.
Re:HTML5 Tidy: The granddaddy of HTML tools by ericb on Wednesday January 13, 2016 @04:10PM (#10897528)
I wrote a ruby gem that wraps the HTML tidy executable for local HTML validation. Disclaimer: It is vetted with the HTML 5 compatible tidy version, but I haven't tried it out with this new version yet. Pull requests welcome.

https://github.com/ericbeland/html_validation

Re:HTML5 Tidy: The granddaddy of HTML tools by martin-adams on Wednesday January 13, 2016 @04:47PM (#10897812)
The one thing I find missing on the site is, when would I use it? What benefit or problem is it solving?

Can anyone share when they've found this to be useful? For example, does it compress HTML for faster page loads, or fix invalid HTML (e.g. from wysiwyg editors).

Re:HTML5 Tidy: The granddaddy of HTML tools by bcg1 on Wednesday January 13, 2016 @05:39PM (#10898199)
tidy is a swiss army knife for HTML and XML... it does the things you said and a lot more.

Pretty printing, switching encodings, conversions between HTML/XHTML, validation, removing those stupid quotation marks that MS Word litters all over the place in its vain attempt to ruin the universe... many annoying problems with HTML are easily solved with tidy

Re:HTML5 Tidy: The granddaddy of HTML tools by jnellis on Wednesday January 13, 2016 @10:10PM (#10899384)
It comes from the early web when scraping web pages was a thing. Html is not always clean, missing end tags, cross nested tags, invalid tags, misused tags or you need xhtml/xml compatible html so you can do xpath/xslt on it.
Re:HTML5 Tidy: The granddaddy of HTML tools by nilliams on Wednesday January 13, 2016 @07:48PM (#10898869)
It's mainly useful for 3rd party (or 'minified') HTML, just to make it readable. It's rare you'd want to use it on HTML you've written yourself.
Re:HTML5 Tidy: The granddaddy of HTML tools by hans-olo on Wednesday January 13, 2016 @03:32PM (#10897253)
The section with the red background is very bright -- it is difficult to read the text.

Please include examples of files cleaned with the tool.

Re:HTML5 Tidy: The granddaddy of HTML tools by masterrex on Wednesday January 13, 2016 @03:08PM (#10897084)
Screenshots. Show input & output.
Re:HTML5 Tidy: The granddaddy of HTML tools by taco_emoji on Wednesday January 13, 2016 @05:13PM (#10898009)
Re:HTML5 Tidy: The granddaddy of HTML tools by legierski on Wednesday January 13, 2016 @04:04PM (#10897486)
Now, if someone could tell me how to use it within PHP...

My company created an open-source HTML-diffing PHP package[0] that could be considerably improved by replacing the old Tidy with the HTML5 Tidy (if I only knew how!)

[0] https://github.com/gathercontent/htmldiff

Re:HTML5 Tidy: The granddaddy of HTML tools by aargh_aargh on Thursday January 14, 2016 @10:45AM (#10902043)
Re:HTML5 Tidy: The granddaddy of HTML tools by rektide on Wednesday January 13, 2016 @03:45PM (#10897350)
Doesn't support tabs, can go DIAF. :-p Or jump in a lake, you downvoting sourpuss sissypants you!

Recently went to check, after a >1 decade break. The man page is 5000 words, tons and tons and tons of options. No tabs though.

Edit: apparently this feature got added last May! Just waiting on my distro now. Sweet! https://github.com/htacg/tidy-html5/issues/108