From effb57608959d01e37b920f38b2c6ab83beb311c Mon Sep 17 00:00:00 2001 From: Chrys Date: Tue, 22 Oct 2019 00:51:09 +0200 Subject: [PATCH] sync --- src/fenrirscreenreader/core/punctuationManager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fenrirscreenreader/core/punctuationManager.py b/src/fenrirscreenreader/core/punctuationManager.py index 9e3b28a5..ee42f6d8 100644 --- a/src/fenrirscreenreader/core/punctuationManager.py +++ b/src/fenrirscreenreader/core/punctuationManager.py @@ -39,8 +39,9 @@ class punctuationManager(): if customDict: for key,item in customDict.items(): try: - if item.upper().startswith('REGEX;') and (len(item) > 6): - resultText = re.sub(str(key), seperator + str(item[6:]) + seperator, resultText) + regexLbl = 'REGEX;' + if item.upper().startswith(regexLbl) and (len(item) > len(regexLbl)): + resultText = re.sub(str(key), seperator + str(item[len(regexLbl):]) + seperator, resultText) else: resultText = resultText.replace(str(key),seperator + str(item) + seperator) except Exception as e: