From 541f4d9c13ca3f6890c3aef742736fc4c177856b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 19 Feb 2020 19:36:41 +0000 Subject: [PATCH] Remove quotes later This allows things like leading or trailing spaces to be matched --- content.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content.py b/content.py index a6c18bb9..19f280c7 100644 --- a/content.py +++ b/content.py @@ -21,7 +21,7 @@ def switchWords(baseDir: str,nickname: str,domain: str,content: str) -> str: return content with open(switchWordsFilename, 'r') as fp: for line in fp: - replaceStr=line.replace('\n','').replace('"','') + replaceStr=line.replace('\n','') wordTransform=None if '->' in replaceStr: wordTransform=replaceStr.split('->') @@ -37,8 +37,8 @@ def switchWords(baseDir: str,nickname: str,domain: str,content: str) -> str: continue if len(wordTransform)==2: content= \ - content.replace(wordTransform[0].strip(), \ - wordTransform[1].strip()) + content.replace(wordTransform[0].strip().replace('"',''), \ + wordTransform[1].strip().replace('"','')) return content def replaceEmojiFromTags(content: str,tag: [],messageType: str) -> str: