RTF Output: ensure proper line breaks.

This commit is contained in:
John Schember 2009-05-28 08:57:29 -04:00
parent da140445a0
commit 08af3996bf

View File

@ -112,7 +112,7 @@ class RTFMLizer(object):
if item.media_type in OEB_IMAGES: if item.media_type in OEB_IMAGES:
src = os.path.basename(item.href) src = os.path.basename(item.href)
data, width, height = self.image_to_hexstring(item.data) data, width, height = self.image_to_hexstring(item.data)
text = text.replace('SPECIAL_IMAGE-%s-REPLACE_ME' % src, '\n\n{\\*\\shppict{\\pict\\picw%i\\pich%i\\jpegblip \n%s}}\n\n' % (width, height, data)) text = text.replace('SPECIAL_IMAGE-%s-REPLACE_ME' % src, '\n\n{\\*\\shppict{\\pict\\picw%i\\pich%i\\jpegblip \n%s\n}}\n\n' % (width, height, data))
return text return text
def image_to_hexstring(self, data): def image_to_hexstring(self, data):
@ -155,6 +155,7 @@ class RTFMLizer(object):
# Remove non-breaking spaces # Remove non-breaking spaces
text = text.replace(u'\xa0', ' ') text = text.replace(u'\xa0', ' ')
text = text.replace('\n\r', '\n')
return text return text