From c7bf6f3a8d7483b0a95794e8a7a8275d91f0a203 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Tue, 10 Mar 2020 13:55:27 -0300 Subject: [PATCH] Renamed _decode_htmlescapes s variable --- pylib/anki/importing/supermemo_xml.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pylib/anki/importing/supermemo_xml.py b/pylib/anki/importing/supermemo_xml.py index a326daf7d..a5ddd582e 100644 --- a/pylib/anki/importing/supermemo_xml.py +++ b/pylib/anki/importing/supermemo_xml.py @@ -143,18 +143,18 @@ class SupermemoXmlImporter(NoteImporter): ] ) - def _decode_htmlescapes(self, s: str) -> str: + def _decode_htmlescapes(self, html: str) -> str: """Unescape HTML code.""" - # In case of bad formated html you can import MinimalSoup etc.. see btflsoup source code - from bs4 import BeautifulSoup as btflsoup + # In case of bad formated html you can import MinimalSoup etc.. see BeautifulSoup source code + from bs4 import BeautifulSoup # my sm2004 also ecaped & char in escaped sequences. - s = re.sub("&", "&", s) + html = re.sub("&", "&", html) # unescaped solitary chars < or > that were ok for minidom confuse btfl soup - # s = re.sub(u'>',u'>',s) - # s = re.sub(u'<',u'<',s) + # html = re.sub(u'>',u'>',html) + # html = re.sub(u'<',u'<',html) - return str(btflsoup(s, "html.parser")) + return str(BeautifulSoup(html, "html.parser")) def _afactor2efactor(self, af: float) -> float: # Adapted from