mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX Input: Fix ToC nesting not working if the styles for the ToC levels dont use integer margins
This commit is contained in:
parent
7fee97c627
commit
1246c326ed
@ -123,7 +123,7 @@ def from_toc(docx, link_map, styles, object_map, log, namespace):
|
|||||||
if txt and href and p is not None:
|
if txt and href and p is not None:
|
||||||
ps = styles.resolve_paragraph(p)
|
ps = styles.resolve_paragraph(p)
|
||||||
try:
|
try:
|
||||||
ml = int(ps.margin_left[:-2])
|
ml = float(ps.margin_left[:-2])
|
||||||
except (TypeError, ValueError, AttributeError):
|
except (TypeError, ValueError, AttributeError):
|
||||||
ml = 0
|
ml = 0
|
||||||
if ps.text_align in {'center', 'right'}:
|
if ps.text_align in {'center', 'right'}:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user