From b5f375cc243f6b75cb98ff6a7fb436bd6147090a Mon Sep 17 00:00:00 2001 From: Arne Ludwig Date: Thu, 30 Jul 2015 12:44:58 +0200 Subject: [PATCH] Adjusted code for bad latex commands to pass tests --- anki/latex.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/anki/latex.py b/anki/latex.py index 9793c55fc..4b1913b68 100644 --- a/anki/latex.py +++ b/anki/latex.py @@ -78,11 +78,11 @@ def _buildImg(col, latex, fname, model): latex = latex.encode("utf8") # it's only really secure if run in a jail, but these are the most common tmplatex = latex.replace("\\includegraphics", "") - for bad in ("write18", "\\\\readline", "\\\\input", "\\\\include", - "\\\\catcode", "\\\\openout", "\\\\write", "\\\\loop", - "\\\\def", "\\\\shipout"): + for bad in ("\\write18", "\\readline", "\\input", "\\include", + "\\catcode", "\\openout", "\\write", "\\loop", + "\\def", "\\shipout"): # don't mind if the sequence is only part of a command - bad_re = bad + "[^a-zA-Z]" + bad_re = "\\" + bad + "[^a-zA-Z]" if re.search(bad_re, tmplatex): return _("""\ For security reasons, '%s' is not allowed on cards. You can still use \