From: W. Trevor King Date: Mon, 10 Dec 2012 23:23:51 +0000 (-0500) Subject: feed: fix Feed._get_entry_content unpacking in Feed._get_entry_title X-Git-Tag: v3.0~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b20592ad495f18f9eb968c90a550f13f6bf8f3bc;p=rss2email.git feed: fix Feed._get_entry_content unpacking in Feed._get_entry_title _get_entry_content returns a single dict, but _get_entry_id had been unpacking it as if it was an object with a `content` attribute. Also convert HTML to text before extracting the title, to avoid things like `

In the beginning...` in the title. Signed-off-by: W. Trevor King --- diff --git a/rss2email/feed.py b/rss2email/feed.py index d7bd74f..30a7667 100644 --- a/rss2email/feed.py +++ b/rss2email/feed.py @@ -448,7 +448,11 @@ class Feed (object): if 'html' in entry.title_detail.type: title = _html2text.html2text(title) else: - title = self._get_entry_content(entry).content[:70] + content = self._get_entry_content(entry) + value = content['value'] + if content['type'] in ('text/html', 'application/xhtml+xml'): + value = _html2text.html2text(value) + title = value[:70] title = title.replace('\n', ' ').strip() return title