Paranoia check for legend_spoilers feature in royalroadl

This commit is contained in:
Jim Miller 2018-04-14 09:29:59 -05:00
parent 04e9a27c06
commit 2db8e070b4

View file

@ -120,8 +120,9 @@ class RoyalRoadAdapter(BaseSiteAdapter):
div.name='fieldset'
legend = topsoup.new_tag('legend')
smalltext = div.find('div',class_='smalltext')
legend.string = stripHTML(smalltext)
smalltext.extract()
if smalltext:
legend.string = stripHTML(smalltext)
smalltext.extract()
div.insert(0,legend)
for inner in div.find_all('div',class_='spoiler-inner'):
del inner['style']