mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PML Output: Remove unnecessary entity to unicode call.
This commit is contained in:
parent
216c27bb3c
commit
4a20c9a582
@ -158,12 +158,6 @@ class PMLMLizer(object):
|
|||||||
text = text.replace(u'\xc2', '')
|
text = text.replace(u'\xc2', '')
|
||||||
text = text.replace(u'\xa0', ' ')
|
text = text.replace(u'\xa0', ' ')
|
||||||
|
|
||||||
# Turn all html entities into unicode. This should not be necessary as
|
|
||||||
# lxml should have already done this but we want to be sure it happens.
|
|
||||||
for entity in set(re.findall('&.+?;', text)):
|
|
||||||
mo = re.search('(%s)' % entity[1:-1], text)
|
|
||||||
text = text.replace(entity, entity_to_unicode(mo))
|
|
||||||
|
|
||||||
# Turn all characters that cannot be represented by themself into their
|
# Turn all characters that cannot be represented by themself into their
|
||||||
# PML code equivelent
|
# PML code equivelent
|
||||||
text = re.sub('[^\x00-\x7f]', lambda x: unipmlcode(x.group()), text)
|
text = re.sub('[^\x00-\x7f]', lambda x: unipmlcode(x.group()), text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user