PML Output: Remove unnecessary entity to unicode call.

This commit is contained in:
John Schember 2009-12-05 21:39:33 -05:00
parent 216c27bb3c
commit 4a20c9a582

View File

@ -158,12 +158,6 @@ class PMLMLizer(object):
text = text.replace(u'\xc2', '')
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
# PML code equivelent
text = re.sub('[^\x00-\x7f]', lambda x: unipmlcode(x.group()), text)