Skip to content

Commit

Permalink
Added xml:lang check for subtitle if title an ordinal and/or roman nu…
Browse files Browse the repository at this point in the history
…meral
  • Loading branch information
drgrigg committed Dec 28, 2023
1 parent 2d0a921 commit ab09a0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion se/se_epub_generate_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,10 @@ def evaluate_descendants(node: EasyXmlElement, toc_item: TocItem, textf: str) ->
if "title" in epub_type: # this allows for `fulltitle` to work here, too
if toc_item.title or toc_item.roman or toc_item.title_is_ordinal: # if title already filled, must be a subtitle
toc_item.subtitle = extract_strings(child)
if toc_item.roman or toc_item.title_is_ordinal: # in these cases, we want to check language on subtitle
toc_item.lang = child.get_attr("xml:lang")
else:
toc_item.title = extract_strings(child)
# this is the only time we need to worry about the language of the title
if not toc_item.lang:
toc_item.lang = child.get_attr("xml:lang")

Expand Down

0 comments on commit ab09a0d

Please sign in to comment.