forked from LiveCarta/BookConverter
fix footer processing
This commit is contained in:
10
src/book.py
10
src/book.py
@@ -495,6 +495,15 @@ class Book:
|
||||
|
||||
self.images = imgs
|
||||
|
||||
def _process_footer(self):
|
||||
"""
|
||||
Function to process <div title="footer"> tags.
|
||||
All the tags will be deleted from file.
|
||||
"""
|
||||
divs = self.body_tag.find_all('div', {'title': 'footer'})
|
||||
for div in divs:
|
||||
div.decompose()
|
||||
|
||||
def _process_div(self):
|
||||
"""
|
||||
Function to process <div> tags. All the tags will be deleted from file, all content of the tags will stay.
|
||||
@@ -608,6 +617,7 @@ class Book:
|
||||
self._process_images()
|
||||
self.log(f'{len(self.images)} images have been processed.')
|
||||
|
||||
self._process_footer()
|
||||
self._process_div()
|
||||
|
||||
self.content = self.body_tag.find_all(recursive=False)
|
||||
|
||||
Reference in New Issue
Block a user