From d66415e2f4714628617912d88ab178278050dd50 Mon Sep 17 00:00:00 2001 From: Matthew Lorentz Date: Mon, 26 Feb 2018 18:52:25 -0500 Subject: [PATCH] Added code to strip html tags from RSS fields --- feed2toot/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feed2toot/main.py b/feed2toot/main.py index 0b379c7..ff1bc22 100644 --- a/feed2toot/main.py +++ b/feed2toot/main.py @@ -31,6 +31,7 @@ from feed2toot.filterentry import FilterEntry from feed2toot.removeduplicates import RemoveDuplicates from feed2toot.tootpost import TootPost from feed2toot.feedcache import FeedCache +from bs4 import BeautifulSoup class Main: '''Main class of Feed2toot''' @@ -183,6 +184,9 @@ class Main: else: finaltweet = dedup.finaltweet + # strip html tags + finaltweet = BeautifulSoup(finaltweet, 'html.parser').get_text() + if clioptions.dryrun: if entrytosend: logging.warning('Would toot with visibility "{visibility}": {toot}'.format(