From b6b2b39cf658903220d8bd2c82f95f8329c58d78 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Nov 2012 14:45:03 +0530 Subject: [PATCH] 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) --- src/calibre/ebooks/oeb/transforms/flatcss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index f963f468aa..28ab4a362c 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -313,7 +313,7 @@ class CSSFlattener(object): if val in ('middle', 'bottom', 'top'): cssdict['vertical-align'] = val elif val in ('left', 'right'): - cssdict['text-align'] = val + cssdict['float'] = val del node.attrib['align'] if node.tag == XHTML('font'): tags = ['descendant::h:%s'%x for x in ('p', 'div', 'table', 'h1',