Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 5, 2024
1 parent 29af0d4 commit 7bb6b4b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mkdocs_rss_plugin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@ def relative_links_resolve_to_page(page_html, page_url):
replaced_html = replaced_html.replace(original, replacement)
return replaced_html

WRAPPER_PATTERNS = [re.compile(p, flags=re.DOTALL) for p in [
'<a class=\"glightbox\".*?>(.*?)</a>',
'<div class=\"grid cards\".*?>(.*?)</div>'
]]

WRAPPER_PATTERNS = [
re.compile(p, flags=re.DOTALL)
for p in [
'<a class="glightbox".*?>(.*?)</a>',
'<div class="grid cards".*?>(.*?)</div>',
]
]


def remove_wrappers(page_html):
for wrapper_pattern in WRAPPER_PATTERNS:
page_html = re.sub(wrapper_pattern, r"\1", page_html)
Expand Down

0 comments on commit 7bb6b4b

Please sign in to comment.