DOCX Input: When converting images placed using the obsolete VML markup default them to being inline rather than block images. Fixes #1905319 [Centered images aren't centered after conversion](https://bugs.launchpad.net/calibre/+bug/1905319)

Also seems to match Word behavior.
This commit is contained in:
Kovid Goyal 2020-11-25 16:24:17 +05:30
parent 3dbbe1397e
commit b6b1af097b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -306,9 +306,12 @@ class Images(object):
except LinkedImageNotFound as err:
self.log.warn('Linked image: %s not found, ignoring' % err.fname)
continue
img = IMG(src='images/%s' % src, style="display:block")
style = get(imagedata.getparent(), 'style')
img = IMG(src='images/%s' % src)
alt = get(imagedata, 'o:title')
img.set('alt', alt or 'Image')
if 'position:absolute' in style:
img.set('style', 'display: block')
yield img
def get_float_properties(self, anchor, style, page):