MOBI Output: Workaround for Amazon's MOBI renderer not rendering top margins on ul and ol tags. Fixes 744365

This commit is contained in:
Kovid Goyal 2011-03-28 10:14:53 -06:00
parent 28a5223eed
commit e7b39e9158

View File

@ -206,7 +206,11 @@ class MobiMLizer(object):
vspace = bstate.vpadding + bstate.vmargin
bstate.vpadding = bstate.vmargin = 0
if tag not in TABLE_TAGS:
wrapper.attrib['height'] = self.mobimlize_measure(vspace)
if tag in ('ul', 'ol') and vspace > 0:
wrapper.addprevious(etree.Element(XHTML('div'),
height=self.mobimlize_measure(vspace)))
else:
wrapper.attrib['height'] = self.mobimlize_measure(vspace)
para.attrib['width'] = self.mobimlize_measure(indent)
elif tag == 'table' and vspace > 0:
vspace = int(round(vspace / self.profile.fbase))