diff --git a/recipes/livemint.recipe b/recipes/livemint.recipe
index b59bfb6b12..2c075d8f78 100644
--- a/recipes/livemint.recipe
+++ b/recipes/livemint.recipe
@@ -103,7 +103,7 @@ class LiveMint(BasicNewsRecipe):
dict(name=['meta', 'link', 'svg', 'button', 'iframe']),
classes(
'trendingSimilarHeight moreNews mobAppDownload label msgError msgOk taboolaHeight gadgetSlider'
- ' socialHolder imgbig disclamerText disqus-comment-count openinApp2 lastAdSlot bs_logo'
+ ' socialHolder imgbig disclamerText disqus-comment-count openinApp2 lastAdSlot bs_logo manualbacklink'
' datePublish sepStory premiumSlider moreStory Joinus moreAbout milestone benefitText'
)
]
@@ -132,7 +132,9 @@ class LiveMint(BasicNewsRecipe):
# remove empty p tags
raw = re.sub(
r'(
\s*)(<[^(\/|a|i|b|em|strong)])', '\g<2>', re.sub(
- r'(
\s* \s*<\/p>)|(
\s*<\/p>)|(
\s*<\/p>)', '', raw
+ r'(
\s* \s*<\/p>)|(
\s*<\/p>)|(
\s*<\/p>)', '', re.sub(
+ r'(?=
\s*Also\s*Read).*?(?<=
)', '', raw
+ )
)
)
if '' in raw:
diff --git a/recipes/natgeo.recipe b/recipes/natgeo.recipe
index 4f902af9cc..40e3da9b8a 100644
--- a/recipes/natgeo.recipe
+++ b/recipes/natgeo.recipe
@@ -35,7 +35,8 @@ def parse_lead_image(media):
yield ''
if 'dsc' in media['image']:
yield '
'.format(
- escape(media['image']['src'], True), escape(media['image']['dsc'], True))
+ escape(media['image']['src'], True), escape(media['image']['dsc'], True)
+ )
else:
yield ''.format(escape(media['image']['src'], True))
if 'caption' in media and 'credit' in media:
@@ -84,7 +85,7 @@ def parse_body(x):
if tag == 'inline':
yield ''.join(parse_inline(x))
elif 'attrs' in x and 'href' in x.get('attrs', ''):
- yield '<' + tag + ' href = "{}">'.format(x['attrs']['href'])
+ yield '<' + tag + ' href="{}">'.format(x['attrs']['href'])
for yld in parse_cont(x):
yield yld
yield '' + tag + '>'
@@ -120,8 +121,7 @@ def parse_article(edg):
for item in main['props']['body']:
if isinstance(item, dict):
if item.get('type', '') == 'inline':
- for inl in parse_inline(item):
- yield inl
+ yield ''.join(parse_inline(item))
elif isinstance(item, list):
for line in item:
yield ''.join(parse_body(line))
diff --git a/recipes/natgeohis.recipe b/recipes/natgeohis.recipe
index d52a63f7c5..aee7c7caa0 100644
--- a/recipes/natgeohis.recipe
+++ b/recipes/natgeohis.recipe
@@ -34,7 +34,8 @@ def parse_lead_image(media):
yield ''
if 'dsc' in media['image']:
yield '
'.format(
- escape(media['image']['src'], True), escape(media['image']['dsc'], True))
+ escape(media['image']['src'], True), escape(media['image']['dsc'], True)
+ )
else:
yield ''.format(escape(media['image']['src'], True))
if 'caption' in media and 'credit' in media:
@@ -83,7 +84,7 @@ def parse_body(x):
if tag == 'inline':
yield ''.join(parse_inline(x))
elif 'attrs' in x and 'href' in x.get('attrs', ''):
- yield '<' + tag + ' href = "{}">'.format(x['attrs']['href'])
+ yield '<' + tag + ' href="{}">'.format(x['attrs']['href'])
for yld in parse_cont(x):
yield yld
yield '' + tag + '>'
@@ -119,8 +120,7 @@ def parse_article(edg):
for item in main['props']['body']:
if isinstance(item, dict):
if item.get('type', '') == 'inline':
- for inl in parse_inline(item):
- yield inl
+ yield ''.join(parse_inline(item))
elif isinstance(item, list):
for line in item:
yield ''.join(parse_body(line))
diff --git a/recipes/natgeomag.recipe b/recipes/natgeomag.recipe
index d4c179c88c..0ad082923e 100644
--- a/recipes/natgeomag.recipe
+++ b/recipes/natgeomag.recipe
@@ -39,7 +39,8 @@ def parse_lead_image(media):
yield ''
if 'dsc' in media['image']:
yield '
'.format(
- escape(media['image']['src'], True), escape(media['image']['dsc'], True))
+ escape(media['image']['src'], True), escape(media['image']['dsc'], True)
+ )
else:
yield ''.format(escape(media['image']['src'], True))
if 'caption' in media and 'credit' in media:
@@ -88,7 +89,7 @@ def parse_body(x):
if tag == 'inline':
yield ''.join(parse_inline(x))
elif 'attrs' in x and 'href' in x.get('attrs', ''):
- yield '<' + tag + ' href = "{}">'.format(x['attrs']['href'])
+ yield '<' + tag + ' href="{}">'.format(x['attrs']['href'])
for yld in parse_cont(x):
yield yld
yield '' + tag + '>'
@@ -124,8 +125,7 @@ def parse_article(edg):
for item in main['props']['body']:
if isinstance(item, dict):
if item.get('type', '') == 'inline':
- for inl in parse_inline(item):
- yield inl
+ yield ''.join(parse_inline(item))
elif isinstance(item, list):
for line in item:
yield ''.join(parse_body(line))