Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages in output in tutorial. #331

Closed
alesya-h opened this issue Aug 21, 2010 · 2 comments
Closed

Error messages in output in tutorial. #331

alesya-h opened this issue Aug 21, 2010 · 2 comments

Comments

@alesya-h
Copy link

http://nokogiri.org/tutorials/modifying_an_html_xml_document.html
at very bottom:

Wrapping a NodeSet

If you wanted to wrap new HTML around each node in a Nodeset, here’s an example of how to do it:

nodes = @doc.css "h1,div"
wrapper = nodes.wrap("<div class='container'></div>")

@doc.to_html
# =>
# ~> /home/miked/.gem/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node_set.rb:235:in 'wrap': undefined method 'parse' for nil:NilClass (NoMethodError)
# ~> from /home/miked/.gem/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node_set.rb:214:in 'each'
# ~> from /home/miked/.gem/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node_set.rb:213:in 'upto'
# ~> from /home/miked/.gem/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node_set.rb:213:in 'each'
# ~> from /home/miked/.gem/ruby/1.8/gems/nokogiri-1.4.2/lib/nokogiri/xml/node_set.rb:234:in 'wrap'
# ~> from -:6

@flavorjones
Copy link
Member

Reproduced. Will look into it.

@flavorjones
Copy link
Member

fixes NodeSet#wrap on fragment nodes. closed by 157a884

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants