mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: When text indent is specified as a percentage in the input document, prevent the generated MOBI from having too large an indent if the user chooses a large output profile like tablet. See #1265226 (Private bug)
This commit is contained in:
parent
80b0842aea
commit
f092a643ae
@ -346,7 +346,13 @@ class MobiMLizer(object):
|
|||||||
if isblock:
|
if isblock:
|
||||||
bstate.para = None
|
bstate.para = None
|
||||||
istate.halign = style['text-align']
|
istate.halign = style['text-align']
|
||||||
|
rawti = style._get('text-indent')
|
||||||
istate.indent = style['text-indent']
|
istate.indent = style['text-indent']
|
||||||
|
if hasattr(rawti, 'strip') and '%' in rawti:
|
||||||
|
# We have a percentage text indent, these can come out looking
|
||||||
|
# too large if the user chooses a wide output profile like
|
||||||
|
# tablet
|
||||||
|
istate.indent = min(style._unit_convert(rawti, base=500), istate.indent)
|
||||||
if style['margin-left'] == 'auto' \
|
if style['margin-left'] == 'auto' \
|
||||||
and style['margin-right'] == 'auto':
|
and style['margin-right'] == 'auto':
|
||||||
istate.halign = 'center'
|
istate.halign = 'center'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user