Fix "span_text not defined" warning

This commit is contained in:
Deniz Şafak
2026-01-09 22:39:49 +03:00
parent ace1022da4
commit bd30939d27
+2 -2
View File
@@ -607,8 +607,8 @@ class EpubParser(BaseBookParser):
# Second fallback: if we have a span but title is still empty, try span text again # 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) # (covered by logic above mostly, but mirroring original logic's intense fallback)
if (not title.strip() or title == "Untitled Section") and span_text: if (not title.strip() or title == "Untitled Section") and span_element:
title = span_text.get_text(strip=True) or title title = span_element.get_text(strip=True) or title
return title return title