Conversion: Fix valign attribute on <td> tags not being honored

This commit is contained in:
Kovid Goyal 2018-01-29 08:48:53 +05:30
parent 02848afe3c
commit d3d5a566ad
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -382,6 +382,10 @@ class CSSFlattener(object):
elif val in ('left', 'right'): elif val in ('left', 'right'):
cssdict['float'] = val cssdict['float'] = val
del node.attrib['align'] del node.attrib['align']
if 'valign' in node.attrib and tag == 'td':
if cssdict.get('vertical-align') == 'inherit':
cssdict['vertical-align'] = node.attrib['valign']
del node.attrib['valign']
if node.tag == XHTML('font'): if node.tag == XHTML('font'):
tags = ['descendant::h:%s'%x for x in ('p', 'div', 'table', 'h1', tags = ['descendant::h:%s'%x for x in ('p', 'div', 'table', 'h1',
'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'dl', 'blockquote')] 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'dl', 'blockquote')]