Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (26 sloc) 1.02 KB
Wraps Tidy gem into String for easier usage.
Allows you to clean up portions of html code in strings,
without any effort.
Defines String#tidy(options={})
Where options hash consists of options from
Please note, option names should be converted from using - to _.
>> "<p>blah".tidy
=> "<p>blah</p>"
>> "blah".tidy
=> "blah"
>> "blah<p>".tidy
=> "blah"
>> "blah".tidy(:show_body_only => false)
=> "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n
<html xmlns=\"\">\n<head>\n
<meta name=\"generator\" content=\n\"HTML Tidy for Mac OS X
(vers 31 October 2006 - Apple Inc. build 13), see\" />
Copyright (c) 2008 Dima Sabanin, released under the MIT license.
Tidy detection code from Bob Aman's FeedTools project used:
Something went wrong with that request. Please try again.