mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix double newlines in items imported from SuperMemo.
When importing SuperMemo XML files, indicate to the BeautifulSoup XML parser that the <br> tag is self-closing. This prevents it from adding a matching </br> for every <br> tag. These extraneous tags resulted in extra newlines in items imported from SuperMemo. While we're at it, fix the same bug for a couple of other self-closing HTML tags.
This commit is contained in:
parent
6c6be1144b
commit
cdcd5eb651
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ class SupermemoXmlImporter(NoteImporter):
|
|||
#s = re.sub(u'>',u'>',s)
|
||||
#s = re.sub(u'<',u'<',s)
|
||||
|
||||
return unicode(btflsoup(s,convertEntities=btflsoup.HTML_ENTITIES ))
|
||||
return unicode(btflsoup(s, selfClosingTags=['br','hr','img','wbr'], convertEntities=btflsoup.HTML_ENTITIES))
|
||||
|
||||
## DEFAULT IMPORTER METHODS
|
||||
|
||||
|
|
Loading…
Reference in a new issue