Skip to content

Instantly share code, notes, and snippets.

@mndoci
Created December 5, 2008 21:47
Show Gist options
  • Save mndoci/32523 to your computer and use it in GitHub Desktop.
Save mndoci/32523 to your computer and use it in GitHub Desktop.
# From Euan's blog post
# http://www.ghastlyfop.com/blog/2008/12/strip-html-tags-from-string-ruby.html
require 'hpricot'
page = Hpricot("<b>some marked up <i>text</i></b>")
puts page.to_plain_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment