Skip to content

Instantly share code, notes, and snippets.

@flavorjones
Created January 6, 2009 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flavorjones/43658 to your computer and use it in GitHub Desktop.
Save flavorjones/43658 to your computer and use it in GitHub Desktop.
# proposed dryopteris API
# returned object with singleton method body()
require 'rubygems'
require 'dryopteris'
haxxored_doc = "<html><head></head><body>haxxored!<script src='http://haxxored.com'></script></body></html>"
sanitized_doc = Dryopteris.sanitize(haxxored_doc)
puts sanitized_doc # => "<html><head></head><body>haxxored!&lt;script src="http://haxxored.com"/&gt;</body></html>"
puts sanitized_doc.body # => "haxxored!&lt;script src="http://haxxored.com"/&gt;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment