mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3513 (conversion bug in Mobi 2 Epub)
This commit is contained in:
parent
983e9bdb48
commit
842d7bed22
@ -504,10 +504,20 @@ class MobiReader(object):
|
|||||||
height = attrib.pop('height').strip()
|
height = attrib.pop('height').strip()
|
||||||
if height and '<' not in height and '>' not in height and \
|
if height and '<' not in height and '>' not in height and \
|
||||||
re.search(r'\d+', height):
|
re.search(r'\d+', height):
|
||||||
|
if tag.tag in ('table', 'td', 'tr'):
|
||||||
|
pass
|
||||||
|
elif tag.tag == 'img':
|
||||||
|
tag.set('height', height)
|
||||||
|
else:
|
||||||
styles.append('margin-top: %s' % self.ensure_unit(height))
|
styles.append('margin-top: %s' % self.ensure_unit(height))
|
||||||
if attrib.has_key('width'):
|
if attrib.has_key('width'):
|
||||||
width = attrib.pop('width').strip()
|
width = attrib.pop('width').strip()
|
||||||
if width and re.search(r'\d+', width):
|
if width and re.search(r'\d+', width):
|
||||||
|
if tag.tag in ('table', 'td', 'tr'):
|
||||||
|
pass
|
||||||
|
elif tag.tag == 'img':
|
||||||
|
tag.set('width', width)
|
||||||
|
else:
|
||||||
styles.append('text-indent: %s' % self.ensure_unit(width))
|
styles.append('text-indent: %s' % self.ensure_unit(width))
|
||||||
if width.startswith('-'):
|
if width.startswith('-'):
|
||||||
styles.append('margin-left: %s' % self.ensure_unit(width[1:]))
|
styles.append('margin-left: %s' % self.ensure_unit(width[1:]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user