You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Same issue here in 1.5.0, this breaks with 1.9.3 which has #type removed.
irb(main):013:0> dom.add_child ''
NoMethodError: undefined method type' for "<root/>":String from /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/xml/document.rb:199:inadd_child'
from (irb):13
from /usr/local/bin/irb19:12:in `
'
According to the docs this should work. When I readd #type
Node#add_child is fine with lots of different types of child -- strings, nodesets, etc...
https://github.com/tenderlove/nokogiri/blob/master/lib/nokogiri/xml/node.rb#L265
...but XML::Document#add_child fails if its parameter doesn't have a "type" method
https://github.com/tenderlove/nokogiri/blob/master/lib/nokogiri/xml/document.rb#L207
This is the sound of the duck typing duck quacking sadly:
I haven't written a test and patch yet but I'd be happy to give it a shot (if I can get nokogiri to build locally).
The text was updated successfully, but these errors were encountered: