From bd30939d27e604a205c09ec2cced7e61426cbb47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20=C5=9Eafak?= Date: Fri, 9 Jan 2026 22:39:49 +0300 Subject: [PATCH] Fix "span_text not defined" warning --- abogen/book_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abogen/book_parser.py b/abogen/book_parser.py index 028d100..af6ef84 100644 --- a/abogen/book_parser.py +++ b/abogen/book_parser.py @@ -607,8 +607,8 @@ class EpubParser(BaseBookParser): # Second fallback: if we have a span but title is still empty, try span text again # (covered by logic above mostly, but mirroring original logic's intense fallback) - if (not title.strip() or title == "Untitled Section") and span_text: - title = span_text.get_text(strip=True) or title + if (not title.strip() or title == "Untitled Section") and span_element: + title = span_element.get_text(strip=True) or title return title