We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
extract_text
1 parent c703d49 commit 1a3a6c1Copy full SHA for 1a3a6c1
inoreader/utils.py
@@ -18,4 +18,20 @@ def extract_text(html_content):
18
return html_content
19
20
content = html.fromstring(html_content)
21
+ for img in content.iter('img'):
22
+ img_src = img.get('src')
23
+ img_alt = img.get('alt') or img_src
24
+ if not img_src:
25
+ continue
26
+
27
+ img.text = '' % (img_alt, img_src)
28
29
+ for link in content.iter('a'):
30
+ url = link.get('href')
31
+ text = link.text or url
32
+ if not url:
33
34
35
+ link.text = '[%s](%s)' % (text, url)
36
37
return content.text_content().replace('\xa0', '').strip()
0 commit comments