From 565c888b4d70e1ce069a02256a8ec4f36994def1 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 29 Jan 2011 13:17:13 -0500 Subject: [PATCH] Fix bug #8640: Missing spaces arouond italic elements. --- src/calibre/ebooks/rtf/rtfml.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/calibre/ebooks/rtf/rtfml.py b/src/calibre/ebooks/rtf/rtfml.py index facc745a5c..383d1547ec 100644 --- a/src/calibre/ebooks/rtf/rtfml.py +++ b/src/calibre/ebooks/rtf/rtfml.py @@ -178,10 +178,6 @@ class RTFMLizer(object): return (hex_string, width, height) def clean_text(self, text): - # Remove excess spaces at beginning and end of lines - text = re.sub('(?m)^[ ]+', '', text) - text = re.sub('(?m)[ ]+$', '', text) - # Remove excessive newlines text = re.sub('%s{3,}' % os.linesep, '%s%s' % (os.linesep, os.linesep), text) @@ -189,6 +185,7 @@ class RTFMLizer(object): text = re.sub('[ ]{2,}', ' ', text) text = re.sub('\t{2,}', '\t', text) + # Remove excessive line breaks text = re.sub(r'(\{\\line \}\s*){3,}', r'{\\line }{\\line }', text) # Remove non-breaking spaces