Conversion: Handle the style attribute on the <html> tag

This commit is contained in:
Kovid Goyal 2013-09-22 21:02:49 +05:30
parent 4a82c5f5ac
commit 2c46d54c47

View File

@ -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')