This commit is contained in:
Kovid Goyal 2024-03-07 11:05:11 +05:30
commit ea411bb6e6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -129,7 +129,7 @@ class LiveMint(BasicNewsRecipe):
def preprocess_raw_html(self, raw, *a): def preprocess_raw_html(self, raw, *a):
# remove empty p tags # remove empty p tags
raw = re.sub(r'(<p>\s*)(<[^\/])', '\g<2>', re.sub(r'(<p>\s*&nbsp;\s*<\/p>)|(<p>\s*<\/p>)', '', raw)) raw = re.sub(r'(<p>\s*&nbsp;\s*<\/p>)|(<p>\s*<\/p>)', '', raw)
if '<script>var wsjFlag=true;</script>' in raw: if '<script>var wsjFlag=true;</script>' in raw:
m = re.search(r'type="application/ld\+json">[^<]+?"@type": "NewsArticle"', raw) m = re.search(r'type="application/ld\+json">[^<]+?"@type": "NewsArticle"', raw)
raw1 = raw[m.start():] raw1 = raw[m.start():]