search for: really_bad

Displaying 1 result from an estimated 1 matches for "really_bad".

2007 May 21
0
How to delete a node with Hpricot?
...question. If a node is bad I''m trying to comment it out. If it''s really bad I''m trynig to delete it. The way I''m trying to do is is as follows. def this_is_a_problem doc = Hpricot( html ) doc.traverse_element do |node| if some_bad_node_test unless really_bad? node.swap( "<!-- comment out node #{node.to_html} -->" ) else node.swap( "" ) end end doc.to_html end However I''m getting a nasty error. TypeError: no implicit conversion from nil to integer /usr/local/lib/ruby/gems/1.8/gems/hpricot-...