开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜