mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Handle invalid entities.
This commit is contained in:
parent
1660c605ba
commit
69f5e6df6b
1 changed files with 4 additions and 1 deletions
|
|
@ -302,4 +302,7 @@ def entity_to_unicode(match):
|
|||
return unichr(int(ent[2:], 16))
|
||||
if ent.startswith(u'#'):
|
||||
return unichr(int(ent[1:]))
|
||||
return unichr(name2codepoint[ent])
|
||||
try:
|
||||
return unichr(name2codepoint[ent])
|
||||
except KeyError:
|
||||
return ent
|
||||
|
|
|
|||
Loading…
Reference in a new issue