From 08af3996bf071701c96ae6427b14b2d7b6ca33b6 Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 28 May 2009 08:57:29 -0400 Subject: [PATCH] RTF Output: ensure proper line breaks. --- src/calibre/ebooks/rtf/rtfml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/rtf/rtfml.py b/src/calibre/ebooks/rtf/rtfml.py index 3ed855adb8..cb8e9af883 100644 --- a/src/calibre/ebooks/rtf/rtfml.py +++ b/src/calibre/ebooks/rtf/rtfml.py @@ -112,7 +112,7 @@ class RTFMLizer(object): if item.media_type in OEB_IMAGES: src = os.path.basename(item.href) 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 def image_to_hexstring(self, data): @@ -155,6 +155,7 @@ class RTFMLizer(object): # Remove non-breaking spaces text = text.replace(u'\xa0', ' ') + text = text.replace('\n\r', '\n') return text