From 060e3ae3ce0bd98b2c93c147de806c356eaa99f1 Mon Sep 17 00:00:00 2001
From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com>
Date: Sat, 13 Sep 2025 14:26:33 +0530
Subject: [PATCH 1/2] Update economist.recipe
Refactor link parsing
---
recipes/economist.recipe | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/recipes/economist.recipe b/recipes/economist.recipe
index 733dd03652..63f3766805 100644
--- a/recipes/economist.recipe
+++ b/recipes/economist.recipe
@@ -62,15 +62,11 @@ def parse_txt(ty):
'italic': lambda: [f'{"".join(parse_txt(c))}' for c in children],
'linebreak': lambda: ['
'],
'external_link': lambda: [
- f'{"".join(parse_txt(children[0]))}'
- ]
- if children
- else [],
+ f'{"".join(parse_txt(c))}' for c in children
+ ],
'internal_link': lambda: [
- f'{"".join(parse_txt(children[0]))}'
- ]
- if children
- else [],
+ f'{"".join(parse_txt(c))}' for c in children
+ ],
'ufinish': lambda: [text for c in children for text in parse_txt(c)],
'subscript': lambda: [f'{"".join(parse_txt(c))}' for c in children],
'superscript': lambda: [f'{"".join(parse_txt(c))}' for c in children],
@@ -278,6 +274,12 @@ class Economist(BasicNewsRecipe):
)
return ans
+ def economist_test_article(self):
+ self.from_web = False
+ return [('Articles', [{'title': 'test',
+ 'url': 'https://www.economist.com/china/2025/09/10/china-is-ditching-the-dollar-fast'
+ }])]
+
def parse_index(self):
# return self.economist_test_article()
edition_date = self.recipe_specific_options.get('date')
From 49a866846c85271d6d86365c9c75363dfbd66a33 Mon Sep 17 00:00:00 2001
From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com>
Date: Sat, 13 Sep 2025 14:27:22 +0530
Subject: [PATCH 2/2] Update economist_free.recipe
---
recipes/economist_free.recipe | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe
index 733dd03652..63f3766805 100644
--- a/recipes/economist_free.recipe
+++ b/recipes/economist_free.recipe
@@ -62,15 +62,11 @@ def parse_txt(ty):
'italic': lambda: [f'{"".join(parse_txt(c))}' for c in children],
'linebreak': lambda: ['
'],
'external_link': lambda: [
- f'{"".join(parse_txt(children[0]))}'
- ]
- if children
- else [],
+ f'{"".join(parse_txt(c))}' for c in children
+ ],
'internal_link': lambda: [
- f'{"".join(parse_txt(children[0]))}'
- ]
- if children
- else [],
+ f'{"".join(parse_txt(c))}' for c in children
+ ],
'ufinish': lambda: [text for c in children for text in parse_txt(c)],
'subscript': lambda: [f'{"".join(parse_txt(c))}' for c in children],
'superscript': lambda: [f'{"".join(parse_txt(c))}' for c in children],
@@ -278,6 +274,12 @@ class Economist(BasicNewsRecipe):
)
return ans
+ def economist_test_article(self):
+ self.from_web = False
+ return [('Articles', [{'title': 'test',
+ 'url': 'https://www.economist.com/china/2025/09/10/china-is-ditching-the-dollar-fast'
+ }])]
+
def parse_index(self):
# return self.economist_test_article()
edition_date = self.recipe_specific_options.get('date')