Skip to content

Commit

Permalink
Fix for webcache replacing curly quotes with entities in headline con…
Browse files Browse the repository at this point in the history
…tent
  • Loading branch information
kovidgoyal committed Apr 22, 2024
1 parent 6de7a4b commit d1bbe63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions recipes/economist.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def load_article_from_json(raw, root):
for child in tuple(body):
body.remove(child)
article = E(body, 'article')
E(article, 'div', data['subheadline'] , style='color: red; font-size:small; font-weight:bold;')
E(article, 'h1', data['headline'])
E(article, 'div', data['description'], style='font-style: italic; color:#202020;')
E(article, 'div', replace_entities(data['subheadline']) , style='color: red; font-size:small; font-weight:bold;')
E(article, 'h1', replace_entities(data['headline']))
E(article, 'div', replace_entities(data['description']), style='font-style: italic; color:#202020;')
if data['dateline'] is None:
E(article, 'p', (data['datePublishedString'] or ''), style='color: gray; font-size:small;')
else:
Expand Down Expand Up @@ -233,7 +233,7 @@ class Economist(BasicNewsRecipe):

def parse_index(self):
# return [('Articles', [{'title':'test',
# 'url':'https://www.economist.com/interactive/briefing/2022/06/11/huge-foundation-models-are-turbo-charging-ai-progress'
# 'url':'https://www.economist.com/the-americas/2024/04/14/elon-musk-is-feuding-with-brazils-powerful-supreme-court'
# }])]
if edition_date:
url = 'https://www.economist.com/weeklyedition/' + edition_date
Expand Down
8 changes: 4 additions & 4 deletions recipes/economist_free.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def load_article_from_json(raw, root):
for child in tuple(body):
body.remove(child)
article = E(body, 'article')
E(article, 'div', data['subheadline'] , style='color: red; font-size:small; font-weight:bold;')
E(article, 'h1', data['headline'])
E(article, 'div', data['description'], style='font-style: italic; color:#202020;')
E(article, 'div', replace_entities(data['subheadline']) , style='color: red; font-size:small; font-weight:bold;')
E(article, 'h1', replace_entities(data['headline']))
E(article, 'div', replace_entities(data['description']), style='font-style: italic; color:#202020;')
if data['dateline'] is None:
E(article, 'p', (data['datePublishedString'] or ''), style='color: gray; font-size:small;')
else:
Expand Down Expand Up @@ -233,7 +233,7 @@ class Economist(BasicNewsRecipe):

def parse_index(self):
# return [('Articles', [{'title':'test',
# 'url':'https://www.economist.com/interactive/briefing/2022/06/11/huge-foundation-models-are-turbo-charging-ai-progress'
# 'url':'https://www.economist.com/the-americas/2024/04/14/elon-musk-is-feuding-with-brazils-powerful-supreme-court'
# }])]
if edition_date:
url = 'https://www.economist.com/weeklyedition/' + edition_date
Expand Down

0 comments on commit d1bbe63

Please sign in to comment.