forked from indymedia/epicyon
Remove quotes later
This allows things like leading or trailing spaces to be matchedmain
parent
4472056cd6
commit
541f4d9c13
|
@ -21,7 +21,7 @@ def switchWords(baseDir: str,nickname: str,domain: str,content: str) -> str:
|
||||||
return content
|
return content
|
||||||
with open(switchWordsFilename, 'r') as fp:
|
with open(switchWordsFilename, 'r') as fp:
|
||||||
for line in fp:
|
for line in fp:
|
||||||
replaceStr=line.replace('\n','').replace('"','')
|
replaceStr=line.replace('\n','')
|
||||||
wordTransform=None
|
wordTransform=None
|
||||||
if '->' in replaceStr:
|
if '->' in replaceStr:
|
||||||
wordTransform=replaceStr.split('->')
|
wordTransform=replaceStr.split('->')
|
||||||
|
@ -37,8 +37,8 @@ def switchWords(baseDir: str,nickname: str,domain: str,content: str) -> str:
|
||||||
continue
|
continue
|
||||||
if len(wordTransform)==2:
|
if len(wordTransform)==2:
|
||||||
content= \
|
content= \
|
||||||
content.replace(wordTransform[0].strip(), \
|
content.replace(wordTransform[0].strip().replace('"',''), \
|
||||||
wordTransform[1].strip())
|
wordTransform[1].strip().replace('"',''))
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def replaceEmojiFromTags(content: str,tag: [],messageType: str) -> str:
|
def replaceEmojiFromTags(content: str,tag: [],messageType: str) -> str:
|
||||||
|
|
Loading…
Reference in New Issue