Skip to content

Commit

Permalink
preserve line breaks in text; add url to original post
Browse files Browse the repository at this point in the history
  • Loading branch information
KristobalJunta committed Aug 29, 2017
1 parent 8f8fb0f commit 754b80b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
soup = BeautifulSoup(content, 'html.parser')
if soup.img:
post['image'] = soup.img['src']
post['text'] = soup.get_text()
post['text'] = '\n'.join(soup.stripped_strings)
post['text'] += '\n\n{}'.format(entry['link'])
if entry['guid'] not in guids:
new_posts.append(post)
guids.append(entry['guid'])
Expand Down

0 comments on commit 754b80b

Please sign in to comment.