diff --git a/anki/latex.py b/anki/latex.py index 062adfcb1..97b1ae496 100644 --- a/anki/latex.py +++ b/anki/latex.py @@ -72,9 +72,10 @@ def _buildImg(col, latex, fname, model): model["latexPost"]) 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"): - if bad in latex: + if bad in tmplatex: return _("""\ For security reasons, '%s' is not allowed on cards. You can still use \ it by placing the command in a different package, and importing that \