From b5740691cc51a6e66abf461c73bc915f76a2e793 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Tue, 11 Oct 2016 00:37:46 -0500 Subject: [PATCH] Special-case people faking tabs in xenforo --- sites/xenforo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sites/xenforo.py b/sites/xenforo.py index 6f323d2..a52c8ca 100644 --- a/sites/xenforo.py +++ b/sites/xenforo.py @@ -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')