From 1246c326edaa945881341409e031a0622ec1a7a1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 Nov 2024 22:00:31 +0530 Subject: [PATCH] DOCX Input: Fix ToC nesting not working if the styles for the ToC levels dont use integer margins --- src/calibre/ebooks/docx/toc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/toc.py b/src/calibre/ebooks/docx/toc.py index e6fb45d951..340515e7da 100644 --- a/src/calibre/ebooks/docx/toc.py +++ b/src/calibre/ebooks/docx/toc.py @@ -123,7 +123,7 @@ def from_toc(docx, link_map, styles, object_map, log, namespace): if txt and href and p is not None: ps = styles.resolve_paragraph(p) try: - ml = int(ps.margin_left[:-2]) + ml = float(ps.margin_left[:-2]) except (TypeError, ValueError, AttributeError): ml = 0 if ps.text_align in {'center', 'right'}: