From 7ba3b5bbf6c46ca0612c6d4054a15e5b5653393b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 4 Mar 2021 16:09:11 +0000 Subject: [PATCH] Replace all double spaces --- speaker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/speaker.py b/speaker.py index 4008ec80a..1405d6659 100644 --- a/speaker.py +++ b/speaker.py @@ -375,7 +375,10 @@ def _postToSpeakerJson(baseDir: str, nickname: str, domain: str, content = removeHtml(htmlReplaceQuoteMarks(content)) content = speakerReplaceLinks(content, translate, detectedLinks) content = _speakerPronounce(baseDir, content, translate) - content = content.replace(' ', ' ').replace(' . ', '. ') + # replace all double spaces + while ' ' in content: + content = content.replace(' ', ' ') + content = content.replace(' . ', '. ') imageDescription = '' if postJsonObject['object'].get('attachment'):