mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
stripHTML() handles entity replacement, which should be done post-strip
This commit is contained in:
parent
59cb45eda6
commit
b66d1479c2
1 changed files with 0 additions and 3 deletions
|
@ -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("<br( /)?>", "\n", latex)
|
||||
# replace <div> etc with spaces
|
||||
latex = re.sub("<.+?>", " ", latex)
|
||||
|
|
Loading…
Reference in a new issue