mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-03-03 07:15:53 +01:00
Get rid of name2codepoint usage in favor of stdlib one.
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
|
import html
|
||||||
import math
|
import math
|
||||||
|
import mimetypes
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import mimetypes
|
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
@@ -287,9 +288,8 @@ def entity_to_unicode(match, exceptions=[], encoding='cp1252',
|
|||||||
return check(html5_entities[ent])
|
return check(html5_entities[ent])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
from ebook_converter.polyglot.html_entities import name2codepoint
|
|
||||||
try:
|
try:
|
||||||
return check(my_unichr(name2codepoint[ent]))
|
return check(my_unichr(html.entities.name2codepoint[ent]))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return '&'+ent+';'
|
return '&'+ent+';'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user