mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 05:07:10 -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):
|
def _removeFormattingFromMathjax(self, txt, ord):
|
||||||
opening = ["\\(", "\\["]
|
opening = ["\\(", "\\["]
|
||||||
closing = ["\\)", "\\]"]
|
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):
|
def repl(m):
|
||||||
enclosed = True
|
enclosed = True
|
||||||
for s in closing:
|
for s in closing:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue