mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle invalid entities.
This commit is contained in:
parent
1660c605ba
commit
69f5e6df6b
@ -302,4 +302,7 @@ def entity_to_unicode(match):
|
|||||||
return unichr(int(ent[2:], 16))
|
return unichr(int(ent[2:], 16))
|
||||||
if ent.startswith(u'#'):
|
if ent.startswith(u'#'):
|
||||||
return unichr(int(ent[1:]))
|
return unichr(int(ent[1:]))
|
||||||
|
try:
|
||||||
return unichr(name2codepoint[ent])
|
return unichr(name2codepoint[ent])
|
||||||
|
except KeyError:
|
||||||
|
return ent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user