aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/mentions.py
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/tasks/mentions.py')
-rw-r--r--webmentions_ssg/tasks/mentions.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/webmentions_ssg/tasks/mentions.py b/webmentions_ssg/tasks/mentions.py
index 4e5a5ca..42dd0b6 100644
--- a/webmentions_ssg/tasks/mentions.py
+++ b/webmentions_ssg/tasks/mentions.py
@@ -31,8 +31,7 @@ HTML_URL_ATTRIBUTES = {
def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool:
- """
- Check whether an HTML document mentions the target URL.
+ """Check whether an HTML document mentions the target URL.
URL references are resolved against the document's ``base`` element when
present, or against the source URL otherwise.
@@ -42,7 +41,6 @@ def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool:
:param target_url: Exact URL to look for.
:return: Whether a supported HTML URL attribute references the target URL.
"""
-
document = BeautifulSoup(body, "html.parser")
base_url = source_url
@@ -67,8 +65,7 @@ def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool:
def text_mentions_target(body: str, target_url: str) -> bool:
- """
- Check whether plain text contains the target IRI, ignoring trailing prose
+ """Check whether plain text contains the target IRI, ignoring trailing prose
punctuation but not extra URL path or query characters.
:param body: Plain-text document body.