mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
lazy-load beautifulsoup
This commit is contained in:
parent
2f2487e5b8
commit
b80fc40aee
1 changed files with 1 additions and 2 deletions
|
@ -18,7 +18,6 @@ from xml.dom import minidom, Node
|
|||
from types import DictType, InstanceType
|
||||
from string import capwords, maketrans
|
||||
import re, unicodedata, time
|
||||
from BeautifulSoup import BeautifulStoneSoup
|
||||
#import chardet
|
||||
|
||||
|
||||
|
@ -133,7 +132,7 @@ class SupermemoXmlImporter(Importer):
|
|||
|
||||
def _decode_htmlescapes(self,s):
|
||||
"""Unescape HTML code."""
|
||||
|
||||
from BeautifulSoup import BeautifulStoneSoup
|
||||
#my sm2004 also ecaped & chars in escaped sequences.
|
||||
s = re.sub(u'&',u'&',s)
|
||||
return unicode(BeautifulStoneSoup(s,convertEntities=BeautifulStoneSoup.HTML_ENTITIES ))
|
||||
|
|
Loading…
Reference in a new issue