From 2c46d54c479e95e00c85fb3f99f235a6efe004a1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Sep 2013 21:02:49 +0530 Subject: [PATCH] Conversion: Handle the style attribute on the tag --- src/calibre/ebooks/oeb/transforms/flatcss.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index eadcdff4d0..9c8442d391 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -227,6 +227,10 @@ class CSSFlattener(object): for item in self.oeb.spine: html = item.data body = html.find(XHTML('body')) + if 'style' in html.attrib: + b = body.attrib.get('style', '') + body.set('style', html.get('style') + ';' + b) + del html.attrib['style'] bs = body.get('style', '').split(';') bs.append('margin-top: 0pt') bs.append('margin-bottom: 0pt')