Fix quotes regex issue and update tests

This commit is contained in:
Veronica Berglyd Olsen
2024-11-03 22:09:16 +01:00
parent 5af49dfc6f
commit 34a3e17326
4 changed files with 80 additions and 16 deletions
+2 -2
View File
@@ -91,11 +91,11 @@ class RegExPatterns:
if CONFIG.dialogStyle in (1, 3):
qO = CONFIG.fmtSQuoteOpen.strip()[:1]
qC = CONFIG.fmtSQuoteClose.strip()[:1]
rx.append(f"(\\B{qO}.*?(?:{qC}\\B{end}))")
rx.append(f"(?:\\B{qO}.*?(?:{qC}\\B{end}))")
if CONFIG.dialogStyle in (2, 3):
qO = CONFIG.fmtDQuoteOpen.strip()[:1]
qC = CONFIG.fmtDQuoteClose.strip()[:1]
rx.append(f"(\\B{qO}.*?(?:{qC}\\B{end}))")
rx.append(f"(?:\\B{qO}.*?(?:{qC}\\B{end}))")
return re.compile("|".join(rx), re.UNICODE)
return None