From 976fc0322435af4324fea3c6d3a116a698736e0a Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Tue, 31 Dec 2019 12:10:50 +0100 Subject: [PATCH] fix truncate messages --- feed2toot/message.py | 1 + 1 file changed, 1 insertion(+) diff --git a/feed2toot/message.py b/feed2toot/message.py index da4f64d..6062d2e 100644 --- a/feed2toot/message.py +++ b/feed2toot/message.py @@ -48,6 +48,7 @@ def build_message(entrytosend, tweetformat, rss, tootmaxlen, notagsintoot): finaltweet = BeautifulSoup(finaltweet, 'html.parser').get_text() # truncate toot to user-defined value whatever the content is if len(finaltweet) > tootmaxlen: + finaltweet = finaltweet[0:tootmaxlen-1] return ''.join([finaltweet[0:-3], '...']) else: return finaltweet