mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
move regex flags to start of string
This commit is contained in:
parent
7ac601f0af
commit
3b71f8e44e
1 changed files with 3 additions and 1 deletions
|
|
@ -209,7 +209,9 @@ class Template:
|
|||
def _removeFormattingFromMathjax(self, txt, ord):
|
||||
opening = ["\\(", "\\["]
|
||||
closing = ["\\)", "\\]"]
|
||||
regex = r"(\\[([])(.*?)"+(clozeReg%ord)+r"(.*?)(\\[\])])"
|
||||
# flags in middle of expression deprecated
|
||||
creg = clozeReg.replace("(?si)", "")
|
||||
regex = r"(?si)(\\[([])(.*?)"+(creg%ord)+r"(.*?)(\\[\])])"
|
||||
def repl(m):
|
||||
enclosed = True
|
||||
for s in closing:
|
||||
|
|
|
|||
Loading…
Reference in a new issue