Skip to content

nokogiri-1.5.0-java inner_text is not respecting inner nodes #521

Open
postmodern opened this Issue Aug 17, 2011 · 1 comment

2 participants

@postmodern

I noticed that Nokogiri::HTML::Node#inner_text was traversing the entire document on JRuby 1.6.3.

Steps to Reproduce

require 'rubygems'
require 'nokogiri'

doc = Nokogiri::HTML(%{
      <html>
        <body>Hello</body>
      </html>
})

doc.at('body').inner_text

Expected Result (Ruby 1.9.2-p290)

"Hello"

Actual Result (JRuby 1.6.3)

"Hello\n      \n"
@yokolet
Sparkle Motion member
yokolet commented Oct 28, 2011

Thanks for reporting. I tried to fix this problem, but couldn't figure out how I should have fixed this. Fixing only this problem was easy, but the change broke many other tests. I honestly don't understand how libxml decides adding spaces and newlines or not.

I'll keep trying to fix this problem. But, probably, not soon. Sorry about this.

@postmodern postmodern referenced this issue in YorickPeterse/oga Apr 3, 2014
Closed

Nokogiri Pain Points #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.