mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-03-03 07:15:53 +01:00
Moved xml_entity_to_unicode partial to utils.entities module.
This commit is contained in:
@@ -27,12 +27,6 @@ class CurrentDir(object):
|
||||
|
||||
|
||||
_ent_pat = re.compile(r'&(\S+?);')
|
||||
xml_entity_to_unicode = partial(entities.entity_to_unicode,
|
||||
result_exceptions={'"': '"',
|
||||
"'": ''',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'&': '&'})
|
||||
|
||||
|
||||
def replace_entities(raw, encoding='cp1252'):
|
||||
@@ -41,7 +35,8 @@ def replace_entities(raw, encoding='cp1252'):
|
||||
|
||||
|
||||
def xml_replace_entities(raw, encoding='cp1252'):
|
||||
return _ent_pat.sub(partial(xml_entity_to_unicode, encoding=encoding), raw)
|
||||
return _ent_pat.sub(partial(entities.xml_entity_to_unicode,
|
||||
encoding=encoding), raw)
|
||||
|
||||
|
||||
def prepare_string_for_xml(raw, attribute=False):
|
||||
|
||||
Reference in New Issue
Block a user