Skip to content

Commit bd30939

Browse files
committed
Fix "span_text not defined" warning
1 parent ace1022 commit bd30939

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

abogen/book_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ def _extract_nav_li_title(self, li_element, link_element=None, span_element=None
607607

608608
# Second fallback: if we have a span but title is still empty, try span text again
609609
# (covered by logic above mostly, but mirroring original logic's intense fallback)
610-
if (not title.strip() or title == "Untitled Section") and span_text:
611-
title = span_text.get_text(strip=True) or title
610+
if (not title.strip() or title == "Untitled Section") and span_element:
611+
title = span_element.get_text(strip=True) or title
612612

613613
return title
614614

0 commit comments

Comments
 (0)