mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Renamed _decode_htmlescapes s variable
This commit is contained in:
parent
131d37dca5
commit
c7bf6f3a8d
1 changed files with 7 additions and 7 deletions
|
@ -143,18 +143,18 @@ class SupermemoXmlImporter(NoteImporter):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
def _decode_htmlescapes(self, s: str) -> str:
|
def _decode_htmlescapes(self, html: str) -> str:
|
||||||
"""Unescape HTML code."""
|
"""Unescape HTML code."""
|
||||||
# In case of bad formated html you can import MinimalSoup etc.. see btflsoup source code
|
# In case of bad formated html you can import MinimalSoup etc.. see BeautifulSoup source code
|
||||||
from bs4 import BeautifulSoup as btflsoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
# my sm2004 also ecaped & char in escaped sequences.
|
# 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
|
# unescaped solitary chars < or > that were ok for minidom confuse btfl soup
|
||||||
# s = re.sub(u'>',u'>',s)
|
# html = re.sub(u'>',u'>',html)
|
||||||
# s = re.sub(u'<',u'<',s)
|
# html = re.sub(u'<',u'<',html)
|
||||||
|
|
||||||
return str(btflsoup(s, "html.parser"))
|
return str(BeautifulSoup(html, "html.parser"))
|
||||||
|
|
||||||
def _afactor2efactor(self, af: float) -> float:
|
def _afactor2efactor(self, af: float) -> float:
|
||||||
# Adapted from <http://www.supermemo.com/beta/xml/xml-core.htm>
|
# Adapted from <http://www.supermemo.com/beta/xml/xml-core.htm>
|
||||||
|
|
Loading…
Reference in a new issue