From e39b903fb31d5afe030c8c6e53cf486babe5626f Mon Sep 17 00:00:00 2001 From: lnu Date: Mon, 19 Sep 2005 13:32:32 +0000 Subject: fix GNA bug #2845 git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@63 f70e237a-67f3-0310-a06c-d2b8a7116972 --- lib/feed2imap/channel.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/feed2imap/channel.rb') diff --git a/lib/feed2imap/channel.rb b/lib/feed2imap/channel.rb index 839d483..3fcc3e8 100644 --- a/lib/feed2imap/channel.rb +++ b/lib/feed2imap/channel.rb @@ -146,10 +146,16 @@ class Item # Content if (e = item.elements['content:encoded']) || (e = item.elements['description'] || item.elements['rss:description']) - if e.cdatas[0] - @content = e.cdatas[0].to_s.toUTF8(@channel.encoding).rmWhiteSpace! - elsif e.text - @content = e.text.toUTF8(@channel.encoding).text2html + if e.children.length > 1 + s = '' + e.children.each { |c| s += c.to_s } + @content = s.toUTF8(@channel.encoding).rmWhiteSpace! + elsif e.children.length == 1 + if e.cdatas[0] + @content = e.cdatas[0].to_s.toUTF8(@channel.encoding).rmWhiteSpace! + elsif e.text + @content = e.text.toUTF8(@channel.encoding).text2html + end end end # Date -- cgit v1.2.3-70-g09d2