This commit is contained in:
Lee 2011-04-13 23:24:34 +08:00
parent d216ced894
commit 330d12c5eb

View File

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