Bugs: Browse | Submit New | Admin
Parsing the following html: <h1> »</h1> will return this error in version 1.09: ArgumentError: invalid value for Integer: "0187" from /opt/local/lib/ruby/gems/1.8/gems/htmltools-1.09/lib/html/sgml-parser.rb:305:in `Integer' from /opt/local/lib/ruby/gems/1.8/gems/htmltools-1.09/lib/html/sgml-parser.rb:305:in `handle_charref' from /opt/local/lib/ruby/gems/1.8/gems/htmltools-1.09/lib/html/sgml-parser.rb:134:in `goahead' from /opt/local/lib/ruby/gems/1.8/gems/htmltools-1.09/lib/html/sgml-parser.rb:66:in `feed'
Add A Comment:
Date: 2007-05-17 02:30 Sender: Daniel Hoey I have also had trouble with this. The following should fix the problem: class HTML::SGMLParser alias_method :handle_charref_old, :handle_charref def handle_charref(name) handle_charref_old(name.gsub(/^0*/, '')) end end