mirror of
https://github.com/kemayo/leech
synced 2025-12-24 01:10:47 +01:00
Xenforo: account for titleless spoilers
This commit is contained in:
parent
178ff6bda7
commit
04f1f6f4a9
1 changed files with 3 additions and 1 deletions
|
|
@ -122,7 +122,9 @@ class XenForo(Site):
|
|||
# spoilers don't work well, so turn them into epub footnotes
|
||||
for idx, spoiler in enumerate(post.find_all(class_='ToggleTriggerAnchor')):
|
||||
link = self._footnote(spoiler.find(class_='SpoilerTarget').extract(), 'chapter%d.html' % chapter_number)
|
||||
link.string = spoiler.find(class_='SpoilerTitle').get_text()
|
||||
spoiler_title = spoiler.find(class_='SpoilerTitle')
|
||||
if spoiler_title:
|
||||
link.string = spoiler_title.get_text()
|
||||
new_spoiler = self._new_tag('div')
|
||||
new_spoiler.append(link)
|
||||
spoiler.replace_with(new_spoiler)
|
||||
|
|
|
|||
Loading…
Reference in a new issue