diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/rss.py | 3 | ||||
| -rw-r--r-- | modules/tweets/format.py | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/modules/rss.py b/modules/rss.py index 159bdbf6..e18ef18b 100644 --- a/modules/rss.py +++ b/modules/rss.py @@ -18,7 +18,8 @@ class Module(ModuleManager.BaseModule): self.bot.get_setting("rss-interval", RSS_INTERVAL)) def _format_entry(self, server, feed_title, entry, shorten): - title = utils.http.strip_html(entry["title"]) + title = utils.parse.line_normalise(utils.http.strip_html( + entry["title"])) author = entry.get("author", None) author = " by %s" % author if author else "" diff --git a/modules/tweets/format.py b/modules/tweets/format.py index 8b84cba3..4d64dffd 100644 --- a/modules/tweets/format.py +++ b/modules/tweets/format.py @@ -7,11 +7,7 @@ def _timestamp(dt): return "%s %s ago" % (since, unit) def _normalise(tweet): - while " " in tweet: - tweet = tweet.replace(" ", " ") - lines = [line.strip() for line in tweet.split("\n")] - lines = list(filter(None, lines)) - return html.unescape(" ".join(lines)) + return html.unescape(utils.parse.line_normalise(tweet)) def _tweet(exports, server, tweet, from_url): linked_id = tweet.id |
