mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 compat
This commit is contained in:
parent
5679a596d0
commit
dec7a51650
@ -475,9 +475,10 @@ class CSSFlattener(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
minlh = self.context.minimum_line_height / 100.
|
minlh = self.context.minimum_line_height / 100.
|
||||||
if not is_drop_cap and style['line-height'] < minlh * fsize:
|
slh = style['line-height']
|
||||||
|
if not is_drop_cap and isinstance(slh, numbers.Number) and slh < minlh * fsize:
|
||||||
cssdict['line-height'] = unicode_type(minlh)
|
cssdict['line-height'] = unicode_type(minlh)
|
||||||
except:
|
except Exception:
|
||||||
self.oeb.logger.exception('Failed to set minimum line-height')
|
self.oeb.logger.exception('Failed to set minimum line-height')
|
||||||
|
|
||||||
if cssdict:
|
if cssdict:
|
||||||
|
@ -240,7 +240,7 @@ def split_string_separator(txt, size):
|
|||||||
'''
|
'''
|
||||||
Splits the text by putting \n\n at the point size.
|
Splits the text by putting \n\n at the point size.
|
||||||
'''
|
'''
|
||||||
if len(txt) > size:
|
if len(txt) > size and size > 2:
|
||||||
size -= 2
|
size -= 2
|
||||||
txt = []
|
txt = []
|
||||||
for part in (txt[i * size: (i + 1) * size] for i in range(0, len(txt), size)):
|
for part in (txt[i * size: (i + 1) * size] for i in range(0, len(txt), size)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user