From: tamouse mailing lists Date: 2013-04-15T02:22:58+09:00 Subject: Re: Why does #content method in nokogiri not printing the full text? I see. You did not actually read what `pp doc` told you, did you? On Sun, Apr 14, 2013 at 12:20 PM, Love U Ruby wrote: > tamouse mailing lists wrote in post #1105601: >> On Sun, Apr 14, 2013 at 11:19 AM, Love U Ruby >> >> (load your code into irb) >> require 'pp' >> pp doc >> >> and see what the structure is. > > Now, I tried > > doc = Nokogiri::HTML::DocumentFragment.parse(html) > pp doc > doc.children.each do |ch| > p ch.content if ch.text? > end > > output: > ======= > children = [ > #(Text "\n\n Rough wind, that moanest loud\n > Grief too sad for song;\n Wild wind, when sullen cloud\n > Knells all the night long;\n Sad storm, whose tears are > vain,\n Bare woods, whose branches strain,\n Deep > caves and dreary main, -\n Wail, for the world's wrong!\n\n > ")] > }), > #(Text "\n\n ") > > -- > "\n\n \n\n " > "\n\n " > > where does go the middle characters between the first "\n\n \n\n " > ? > > -- > Posted via http://www.ruby-forum.com/. >