forked from LiveCarta/BookConverter
Change processing of Section|Part Chapters
This commit is contained in:
@@ -255,7 +255,7 @@ class EpubConverter:
|
|||||||
|
|
||||||
sub_nodes = []
|
sub_nodes = []
|
||||||
for elem in second:
|
for elem in second:
|
||||||
if ("section" in first.title.lower() or "part" in first.title.lower()) and lvl == 1:
|
if (bool(re.search('^section$|^part$', first.title.lower()))) and lvl == 1:
|
||||||
self.offset_sub_nodes.append(
|
self.offset_sub_nodes.append(
|
||||||
self.build_adjacency_list_from_toc(elem, lvl))
|
self.build_adjacency_list_from_toc(elem, lvl))
|
||||||
else:
|
else:
|
||||||
@@ -634,7 +634,7 @@ class EpubConverter:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
epub_file_path = "../../epub/9781614382264.epub"
|
epub_file_path = "../../epub/9780763774134.epub"
|
||||||
logger_object = BookLogger(
|
logger_object = BookLogger(
|
||||||
name="epub", book_id=epub_file_path.split("/")[-1])
|
name="epub", book_id=epub_file_path.split("/")[-1])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user