This commit is contained in:
Lee 2011-04-14 18:34:49 +08:00
parent 6a3d5f3af4
commit ecf21962d5

View File

@ -464,10 +464,9 @@ class MobiMLizer(object):
valign = style['vertical-align']
not_baseline = valign in ('super', 'sub', 'text-top',
'text-bottom') or (
isinstance(valign, (float, int)) and abs(valign) != 0) or (
tag in ('sup', 'sub'))
isinstance(valign, (float, int)) and abs(valign) != 0)
issup = valign in ('super', 'text-top') or (
isinstance(valign, (float, int)) and valign > 0) or tag == 'sup'
isinstance(valign, (float, int)) and valign > 0)
vtag = 'sup' if issup else 'sub'
if not_baseline and not ignore_valign and tag not in NOT_VTAGS and not isblock:
nroot = etree.Element(XHTML('html'), nsmap=MOBI_NSMAP)