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
Issue when parsing top-level node in document fragments with nokogiri 1.4.2:
(gist at http://gist.github.com/413419)
$ irb
>> a = "<br><p>Hey</p>"
=> "<br><p>Hey</p>"
>> b = Nokogiri::HTML.fragment a
=> #<Nokogiri::HTML::DocumentFragment:0x455e318 name="#document-fragment" children=[#<Nokogiri::XML::Element:0x455e14a name="br">, #<Nokogiri::XML::Element:0x455e12e name="p" children=[#<Nokogiri::XML::Text:0x455dba8 "Hey">]>]>
>> b.inner_html
=> "<br><p>Hey</p>"
>> b.inner_html = ""
RuntimeError: no contextual parsing on unlinked nodes
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:443:in `in_context'
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:443:in `parse'
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/html/document_fragment.rb:16:in `initialize'
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:424:in `new'
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:424:in `fragment'
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:776:in `coerce'
from /local/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2/lib/nokogiri/xml/node.rb:313:in `inner_html='
from (irb):6
from /local/bin/irb:12:in `<main>'
The text was updated successfully, but these errors were encountered:
Issue when parsing top-level node in document fragments with nokogiri 1.4.2:
(gist at http://gist.github.com/413419)
The text was updated successfully, but these errors were encountered: