def strip_html(html)
      return @stripped_html if @stripped_html
      allowed = @settings[:allowed_tags]
      reg = if allowed.any?
        Regexp.new(
          %(<(?!(\\s|\\/)*(#{
            allowed.map {|tag| Regexp.escape( tag )}.join( "|" )
          })( |>|\\/|'|"|<|\\s*\\z))[^>]*(>+|\\s*\\z)),
          Regexp::IGNORECASE | Regexp::MULTILINE, 'u'
        )
      else
        /<[^>]*(>+|\s*\z)/m
      end
       @stripped_html = html.gsub(reg,'')
    end
def strip_html(html)
      return @stripped_html if @stripped_html
      allowed = @settings[:allowed_tags]
      reg = if allowed.any?
        Regexp.new(
          %(<(?!(\\s|\\/)*(#{
            allowed.map {|tag| Regexp.escape( tag )}.join( "|" )
          })( |>|\\/|'|"|<|\\s*\\z))[^>]*(>+|\\s*\\z)),
          Regexp::IGNORECASE | Regexp::MULTILINE, 'u'
        )
      else
        /<[^>]*(>+|\s*\z)/m
      end
       @stripped_html = html.gsub(reg,'')
    end
Removes HTML tags from a string. Allows you to specify some tags to be kept.
 @see http://codesnippets.joyent.com/posts/show/1354#comment-293