forked from LiveCarta/BookConverter
Add condition in offsetting with title
This commit is contained in:
@@ -214,7 +214,7 @@ class EpubConverter:
|
||||
|
||||
sub_nodes = []
|
||||
for elem in second:
|
||||
if 'section' in first.title.lower() or 'part' in first.title.lower():
|
||||
if ('section' in first.title.lower() or 'part' in first.title.lower()) and lvl == 1:
|
||||
self.offset_sub_nodes.append(self.build_adjacency_list_from_toc(elem, lvl))
|
||||
else:
|
||||
sub_nodes.append(
|
||||
@@ -510,7 +510,7 @@ if __name__ == "__main__":
|
||||
|
||||
logger_object = BookLogger(name=f'epub', main_logger=logger, book_id=0)
|
||||
|
||||
json_converter = EpubConverter('../../epub/9781641050234.epub',
|
||||
json_converter = EpubConverter('../../epub/9781634254878.epub',
|
||||
logger=logger_object)
|
||||
tmp = json_converter.convert_to_dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user