Conversion: Correctly handle values of left, right for the deprecated align attribute of images, mapping them to the CSS float property instead of text-align. Fixes #1081094 (Text not wrapping alongside images that are left/right aligned when converting to epub)

This commit is contained in:
Kovid Goyal 2012-11-22 14:45:03 +05:30
parent f7310d5b99
commit b6b2b39cf6

View File

@ -313,7 +313,7 @@ class CSSFlattener(object):
if val in ('middle', 'bottom', 'top'): if val in ('middle', 'bottom', 'top'):
cssdict['vertical-align'] = val cssdict['vertical-align'] = val
elif val in ('left', 'right'): elif val in ('left', 'right'):
cssdict['text-align'] = val cssdict['float'] = val
del node.attrib['align'] del node.attrib['align']
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',