1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-22 00:04:16 +01:00

Special-case people faking tabs in xenforo

This commit is contained in:
David Lynch 2016-10-11 00:37:46 -05:00
parent dd0248ffa0
commit b5740691cc

View file

@ -119,7 +119,12 @@ class XenForo(Site):
post.name = 'div'
# mostly, we want to remove colors because the Kindle is terrible at them
for tag in post.find_all(style=True):
del(tag['style'])
if tag['style'] == 'color: transparent' and tag.text == 'TAB':
# Some stories fake paragraph indents like this. The output
# stylesheet will handle this just fine.
tag.extract()
else:
del(tag['style'])
# spoilers don't work well, so turn them into epub footnotes
for idx, spoiler in enumerate(post.find_all(class_='ToggleTriggerAnchor')):
spoiler_title = spoiler.find(class_='SpoilerTitle')