From 0340ee6ab42a310482ba749cd01138a8393a6912 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Nov 2010 12:28:06 -0700 Subject: [PATCH] made conversion of nbsp to indent a bit smarter in preprocess code --- src/calibre/ebooks/conversion/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/conversion/utils.py b/src/calibre/ebooks/conversion/utils.py index f75fe71c82..41f276294a 100644 --- a/src/calibre/ebooks/conversion/utils.py +++ b/src/calibre/ebooks/conversion/utils.py @@ -44,10 +44,14 @@ class PreProcessor(object): span = match.group('span') self.found_indents = self.found_indents + 1 if pstyle: - if not span: - return '

' + if pstyle.lower().find('style'): + pstyle = re.sub(r'"$', '; text-indent:3%"', pstyle) else: - return '

'+span + pstyle = pstyle+' style="text-indent:3%"' + if not span: + return '

' + else: + return '

'+span else: if not span: return '

'