From fceb2d80b80e54cbf3a4dbe6c83d87f8de0bbd96 Mon Sep 17 00:00:00 2001 From: woorst Date: Mon, 22 Oct 2018 04:36:56 -0400 Subject: [PATCH] selftext_html replaced with '' when not defined --- rtv/content.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtv/content.py b/rtv/content.py index 411110d..6a773e7 100644 --- a/rtv/content.py +++ b/rtv/content.py @@ -219,7 +219,7 @@ class Content(object): data['type'] = 'Submission' data['title'] = sub.title data['text'] = sub.selftext - data['html'] = sub.selftext_html + data['html'] = sub.selftext_html or '' data['created'] = cls.humanize_timestamp(sub.created_utc) data['created_long'] = cls.humanize_timestamp(sub.created_utc, True) data['comments'] = '{0} comments'.format(sub.num_comments) @@ -321,7 +321,7 @@ class Content(object): @staticmethod def extract_links(html): """ - Extract a list of hyperlinks from an HTMl document. + Extract a list of hyperlinks from an HTML document. """ links = [] soup = BeautifulSoup(html, 'html.parser')