From b66d1479c20abe2e3b4d9368367a1418f217c6f2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 7 Sep 2012 04:54:59 +0900 Subject: [PATCH] stripHTML() handles entity replacement, which should be done post-strip --- anki/latex.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/anki/latex.py b/anki/latex.py index f46e0a654..e4d7fbbb9 100644 --- a/anki/latex.py +++ b/anki/latex.py @@ -64,9 +64,6 @@ def _latexFromHtml(col, latex): # entitydefs defines nbsp as \xa0 instead of a standard space, so we # replace it first latex = latex.replace(" ", " ") - for match in re.compile("&([a-z]+);", re.IGNORECASE).finditer(latex): - if match.group(1) in entitydefs: - latex = latex.replace(match.group(), entitydefs[match.group(1)]) latex = re.sub("", "\n", latex) # replace
etc with spaces latex = re.sub("<.+?>", " ", latex)