possible fix for supermemo importer (#480)

Not sure why the original author was converting angle brackets separately -
that code breaks the example provided in #480, but I'm not sure if removing it
will break other files.
This commit is contained in:
Damien Elmes 2013-01-15 06:37:30 +09:00
parent c3d7a63f7e
commit e610776bb0

View file

@ -63,6 +63,7 @@ class SuperMemoElement(SmartDict):
class SupermemoXmlImporter(NoteImporter): class SupermemoXmlImporter(NoteImporter):
needMapper = False needMapper = False
allowHTML = True
""" """
Supermemo XML export's to Anki parser. Supermemo XML export's to Anki parser.
@ -136,8 +137,8 @@ class SupermemoXmlImporter(NoteImporter):
#my sm2004 also ecaped & char in escaped sequences. #my sm2004 also ecaped & char in escaped sequences.
s = re.sub(u'&',u'&',s) s = re.sub(u'&',u'&',s)
#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'&gt;',s) #s = re.sub(u'>',u'&gt;',s)
s = re.sub(u'<',u'&lt;',s) #s = re.sub(u'<',u'&lt;',s)
return unicode(btflsoup(s,convertEntities=btflsoup.HTML_ENTITIES )) return unicode(btflsoup(s,convertEntities=btflsoup.HTML_ENTITIES ))