mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-03-24 03:13:34 +01:00
Moved prepare_string_for_xml to utils.entities.
This commit is contained in:
@@ -24,14 +24,3 @@ class CurrentDir(object):
|
||||
except EnvironmentError:
|
||||
# The previous CWD no longer exists
|
||||
pass
|
||||
|
||||
|
||||
_ent_pat = re.compile(r'&(\S+?);')
|
||||
|
||||
|
||||
def prepare_string_for_xml(raw, attribute=False):
|
||||
raw = _ent_pat.sub(entities.entity_to_unicode, raw)
|
||||
raw = raw.replace('&', '&').replace('<', '<').replace('>', '>')
|
||||
if attribute:
|
||||
raw = raw.replace('"', '"').replace("'", ''')
|
||||
return raw
|
||||
|
||||
Reference in New Issue
Block a user