forked from LiveCarta/BookConverter
epub converter: update footnotes
This commit is contained in:
@@ -48,8 +48,15 @@ class EpubPostprocessor:
|
||||
|
||||
self.logger.log('Footnotes processing.')
|
||||
self.footnotes = []
|
||||
self.noterefs = []
|
||||
for href in self.href2soup_html:
|
||||
self.footnotes.extend(preprocess_footnotes(self.href2soup_html[href], self.href2soup_html))
|
||||
footnotes, noterefs = preprocess_footnotes(self.href2soup_html[href], self.href2soup_html)
|
||||
self.footnotes.extend(footnotes)
|
||||
self.noterefs.extend(noterefs)
|
||||
for i, noteref in enumerate(self.noterefs):
|
||||
noteref.attrs['data-id'] = i + 1
|
||||
noteref.attrs['id'] = f'footnote-{i + 1}'
|
||||
|
||||
self.logger.log(f'Added {len(self.footnotes)} footnotes.')
|
||||
self.logger.log('TOC processing.')
|
||||
self.href2subchapter_ids = defaultdict(list)
|
||||
|
||||
Reference in New Issue
Block a user