1
0
Fork 0
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:
David Lynch 2015-12-16 15:35:30 -06:00
parent 178ff6bda7
commit 04f1f6f4a9

View file

@ -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)