From b20592ad495f18f9eb968c90a550f13f6bf8f3bc Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 10 Dec 2012 18:23:51 -0500 Subject: [PATCH] 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 --- rss2email/feed.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.26.2