We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the following session I'd expect three text nodes"
[1] pry(main)> require 'nokogiri' => true [2] pry(main)> Nokogiri::VERSION => "1.6.7.2" [3] pry(main)> doc = Nokogiri::HTML.fragment 'some text <p>more text</p> excess text' => #(DocumentFragment:0x2acb9d91fc60 { name = "#document-fragment", children = [ #(Text "some text "), #(Element:0x2acb9d91f7b0 { name = "p", children = [ #(Text "more text")] }), #(Text " excess text")] }) [4] pry(main)> doc.xpath('//text()') => [] [5] pry(main)> doc.xpath('text()') => [#<Nokogiri::XML::Text:0x2acb9d91f8a0 "some text ">, #<Nokogiri::XML::Text:0x2acb9d91f65c " excess text">] [6] pry(main)> RUBY_VERSION => "2.1.5" [7] pry(main)> RUBY_PLATFORM => "x86_64-linux"
I didn't do any special. Just gem install.
gem install
The text was updated successfully, but these errors were encountered:
There are some known edge cases around xpath-searching fragments; the workaround is to search with ".//" as the prefix:
2.3.1 :007 > doc.xpath ".//text()" => [#<Nokogiri::XML::Text:0x86e1d8 "some text ">, #<Nokogiri::XML::Text:0xadd950 "more text">, #<Nokogiri::XML::Text:0xaddf7c " excess text">]
We should really fix this. Leaving open.
Sorry, something went wrong.
This is the same issue described in #572, closing.
No branches or pull requests
In the following session I'd expect three text nodes"
I didn't do any special. Just
gem install
.The text was updated successfully, but these errors were encountered: