1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-01-16 08:44:11 +01:00

Get rid of name2codepoint usage in favor of stdlib one.

This commit is contained in:
2020-06-17 17:42:47 +02:00
parent b4b02a4893
commit f31fb5e971

View File

@@ -1,9 +1,10 @@
import html
import math
import mimetypes
import os
import pkg_resources
import re
import sys
import mimetypes
from functools import partial
@@ -287,9 +288,8 @@ def entity_to_unicode(match, exceptions=[], encoding='cp1252',
return check(html5_entities[ent])
except KeyError:
pass
from ebook_converter.polyglot.html_entities import name2codepoint
try:
return check(my_unichr(name2codepoint[ent]))
return check(my_unichr(html.entities.name2codepoint[ent]))
except KeyError:
return '&'+ent+';'