From f9d405ebe0ed6a5ffdd34f420108def3cf943e2f Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 20 Feb 2011 13:56:00 -0500 Subject: [PATCH] Fix bug #8927: FB2 paragraph spacing issue. --- src/calibre/ebooks/fb2/fb2ml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index 6af058da7b..43f93807a1 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -350,6 +350,8 @@ class FB2MLizer(object): # Number of blank lines above tag try: ems = int(round((float(style.marginTop) / style.fontSize) - 1)) + if ems < 0: + ems = 0 except: ems = 0 @@ -397,7 +399,7 @@ class FB2MLizer(object): fb2_out += p_txt tags += p_tag fb2_out.append('' % self.image_hrefs[page.abshref(elem_tree.attrib['src'])]) - if tag in ('br', 'hr') or ems: + if tag in ('br', 'hr') or ems >= 1: if ems < 1: multiplier = 1 else: