Skip to content

Instantly share code, notes, and snippets.

@jpignata
Created March 7, 2010 14:45
Show Gist options
  • Save jpignata/324394 to your computer and use it in GitHub Desktop.
Save jpignata/324394 to your computer and use it in GitHub Desktop.
module Minimal
module Tidy
def to_tidy
pipe = IO.popen("tidy -q 2>/dev/null", "r+")
pipe.write to_s
pipe.close_write
pipe.read
end
end
end
class String
include Minimal::Tidy
end
p"<p>blah?<p>".to_tidy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment