mirror of
https://github.com/kemayo/leech
synced 2025-12-06 08:22:56 +01:00
Stop xenforo from over-stripping styles
This commit is contained in:
parent
b3489d5016
commit
a71ac62f8b
1 changed files with 3 additions and 1 deletions
|
|
@ -288,11 +288,13 @@ class XenForo(Site):
|
||||||
# TODO: more robust CSS parsing? This is very whitespace dependent, if nothing else.
|
# TODO: more robust CSS parsing? This is very whitespace dependent, if nothing else.
|
||||||
if "font-family: 'Courier New'" in tag['style']:
|
if "font-family: 'Courier New'" in tag['style']:
|
||||||
tag.wrap(self._new_tag('code'))
|
tag.wrap(self._new_tag('code'))
|
||||||
|
tag['style'] = tag['style'].replace("", '')
|
||||||
|
tag['style'] = re.sub(r"font-family: 'Courier New';?", '', tag['style'])
|
||||||
if "text-decoration: strikethrough" in tag['style']:
|
if "text-decoration: strikethrough" in tag['style']:
|
||||||
tag.wrap(self._new_tag('strike'))
|
tag.wrap(self._new_tag('strike'))
|
||||||
|
tag['style'] = re.sub(r'text-decoration: strikethrough;?', '', tag['style'])
|
||||||
if "margin-left" in tag['style']:
|
if "margin-left" in tag['style']:
|
||||||
continue
|
continue
|
||||||
del tag['style']
|
|
||||||
for tag in post.select('.quoteExpand, .bbCodeBlock-expandLink, .bbCodeBlock-shrinkLink'):
|
for tag in post.select('.quoteExpand, .bbCodeBlock-expandLink, .bbCodeBlock-shrinkLink'):
|
||||||
tag.decompose()
|
tag.decompose()
|
||||||
for tag in post.find_all('noscript'):
|
for tag in post.find_all('noscript'):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue