converter fix: font-size removed from footnotes

This commit is contained in:
shirshasa
2020-10-30 00:17:29 +03:00
parent 813c5962c9
commit fb6a9aea6c

View File

@@ -322,6 +322,15 @@ class HTMLPreprocessor:
for tag_a in cont_tag.find_all('a', {'class': 'sdfootnotesym'}): for tag_a in cont_tag.find_all('a', {'class': 'sdfootnotesym'}):
tag_a.decompose() tag_a.decompose()
# remove font-size
for span in cont_tag.find_all('span', {'style': re.compile('font-size')}):
style = span.get('style')
style = re.sub(r"font-size: \d+px", "", style)
if style == '':
del span.attrs['style']
else:
span.attrs['style'] = style
unicode_string = '' unicode_string = ''
for child in cont_tag.children: for child in cont_tag.children:
if type(child) is NavigableString: if type(child) is NavigableString: