mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:43:27 +02:00
RTF Output: ensure proper line breaks.
This commit is contained in:
parent
da140445a0
commit
08af3996bf
1 changed files with 2 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ def insert_images(self, text):
|
|||
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 @@ def clean_text(self, text):
|
|||
|
||||
# Remove non-breaking spaces
|
||||
text = text.replace(u'\xa0', ' ')
|
||||
text = text.replace('\n\r', '\n')
|
||||
|
||||
return text
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue