Formatting HTML Source using Ruby
Is there any Ruby library available to format the HTML source. By formatting I开发者_如何转开发 mean removing the extra spacing, apply proper indentation etc.
I am already using Hpricot for parsing HTML. It would be nice if Hpricot could do this job. But I am not stick with Hpricot for the formatting stuff.
Thanks, Imran
Check out this Ruby interface to the HTML Tidy library.
Extra spacing and formatting don't really matter in HTML, so regardless of the formatting and white space, the browser should display the code as the same.
精彩评论