Use the same name for the html field everywhere
This commit is contained in:
@@ -148,7 +148,7 @@ class Content(object):
|
||||
data['type'] = 'Comment'
|
||||
data['level'] = comment.nested_level
|
||||
data['body'] = comment.body
|
||||
data['body_html'] = comment.body_html
|
||||
data['html'] = comment.body_html
|
||||
data['created'] = cls.humanize_timestamp(comment.created_utc)
|
||||
data['score'] = '{0} pts'.format(
|
||||
'-' if comment.score_hidden else comment.score)
|
||||
@@ -218,7 +218,7 @@ class Content(object):
|
||||
data['type'] = 'Submission'
|
||||
data['title'] = sub.title
|
||||
data['text'] = sub.selftext
|
||||
data['text_html'] = sub.selftext_html
|
||||
data['html'] = sub.selftext_html
|
||||
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)
|
||||
|
||||
@@ -156,10 +156,8 @@ class SubmissionPage(Page):
|
||||
|
||||
def open_submission_or_permalink_or_mentioned_link(self, data):
|
||||
links_in_data = []
|
||||
if 'body_html' in data and data['body_html']:
|
||||
links_in_data = self.get_links_in_html(data['body_html'])
|
||||
elif 'text_html' in data and data['text_html']:
|
||||
links_in_data = self.get_links_in_html(data['text_html'])
|
||||
if data['html']:
|
||||
links_in_data = self.get_links_in_html(data['html'])
|
||||
|
||||
if links_in_data:
|
||||
self.prompt_user_and_open_selected_link(data, links_in_data)
|
||||
|
||||
Reference in New Issue
Block a user