wtnabe (owner)

Revisions

gist: 226457 Download_button fork
public
Public Clone URL: git://gist.github.com/226457.git
Embed All Files: show embed
strip_tags.rb #
1
2
3
4
5
6
7
8
9
10
require 'rubygems'
require 'hpricot'
$KCODE = 'u'
 
def strip_tags( html )
  Hpricot( html ).inner_text.gsub( /(?:\xc2\xa0| #  
\xe3\x80\x80| # fullwidth
[\s])+/x, ' ' ).strip
end