From 4a568a83be44a146b96a789928b0b499ee857d08 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 17 Apr 2011 06:59:46 +0900 Subject: [PATCH] strip html from latex so clozes work properly in the future we could look at replacing the cloze html with something prettier, but it might cause latex errors --- anki/latex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/latex.py b/anki/latex.py index 557a72295..fd6887266 100644 --- a/anki/latex.py +++ b/anki/latex.py @@ -3,7 +3,7 @@ # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import re, os, sys, shutil, cgi, subprocess -from anki.utils import checksum, call, namedtmp, tmpdir, isMac +from anki.utils import checksum, call, namedtmp, tmpdir, isMac, stripHTML from anki.hooks import addHook from htmlentitydefs import entitydefs from anki.lang import _ @@ -65,6 +65,7 @@ def _latexFromHtml(deck, latex): if match.group(1) in entitydefs: latex = latex.replace(match.group(), entitydefs[match.group(1)]) latex = re.sub("", "\n", latex) + latex = stripHTML(latex) latex = latex.encode("utf-8") return latex