mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
better message when bad latex word encountered
This commit is contained in:
parent
e2d0ef0cc4
commit
c9b3d89d44
1 changed files with 5 additions and 1 deletions
|
@ -79,7 +79,11 @@ def _buildImg(col, latex, fname, model):
|
||||||
# it's only really secure if run in a jail, but these are the most common
|
# it's only really secure if run in a jail, but these are the most common
|
||||||
for bad in ("write18", "\\readline", "\\input", "\\include", "\\catcode",
|
for bad in ("write18", "\\readline", "\\input", "\\include", "\\catcode",
|
||||||
"\\openout", "\\write", "\\loop", "\\def", "\\shipout"):
|
"\\openout", "\\write", "\\loop", "\\def", "\\shipout"):
|
||||||
assert bad not in latex
|
if bad in latex:
|
||||||
|
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 \
|
||||||
|
package in the LaTeX header instead.""") % bad
|
||||||
# write into a temp file
|
# write into a temp file
|
||||||
log = open(namedtmp("latex_log.txt"), "w")
|
log = open(namedtmp("latex_log.txt"), "w")
|
||||||
texpath = namedtmp("tmp.tex")
|
texpath = namedtmp("tmp.tex")
|
||||||
|
|
Loading…
Reference in a new issue