Skip to content

Commit

Permalink
Fix the royalroad stolen-content removal
Browse files Browse the repository at this point in the history
They added speak:none to the CSS, and I was strictly checking for a rule
that only contained display:none.
  • Loading branch information
kemayo committed Feb 11, 2024
1 parent 64d77b6 commit cc423f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sites/royalroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _clean(self, contents, full_page):
# HTML, and hiding them with CSS. Currently the CSS is very easy to
# find, so do so and filter them out.
for style in full_page.find_all('style'):
if m := re.match(r'\s*\.(\w+)\s*{\s*display:\s*none;\s*}', style.string):
if m := re.match(r'\s*\.(\w+)\s*{[^}]*display:\s*none;[^}]*}', style.string):
for warning in contents.find_all(class_=m.group(1)):
warning.decompose()

Expand Down

0 comments on commit cc423f6

Please sign in to comment.