Ben Brinckerhoff



I'm Ben Brinckerhoff.
email
Twitter
del.icio.us
GitHub
LinkedIn

Kiva - loans that change lives


Link

Feb 15, 2009
@ 7:36 pm
Permalink

Hpricot's inner_text doesn't handle HTML entities correctly - Ruby - hpricot, inner_text, problem, bug »

require ‘rubygems’ 2 require ‘htmlentities’ 3 4 def inner_text(node) 5 text = node.innerHTML.gsub(%r{<.*?>}, “”).strip 6 HTMLEntities.new.decode(text) 7 end