mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
escape backslash in find&replace
https://anki.tenderapp.com/discussions/ankidesktop/35903-bug-find-and-replace-breaks-when-replacing-with-latexmathjax-commands
This commit is contained in:
parent
d46899943c
commit
6b784ae42e
1 changed files with 1 additions and 0 deletions
|
@ -492,6 +492,7 @@ def findReplace(col, nids, src, dst, regex=False, field=None, fold=True):
|
|||
# find and gather replacements
|
||||
if not regex:
|
||||
src = re.escape(src)
|
||||
dst = dst.replace("\\", "\\\\")
|
||||
if fold:
|
||||
src = "(?i)"+src
|
||||
regex = re.compile(src)
|
||||
|
|
Loading…
Reference in a new issue