diff --git a/src/linkotron/__init__.py b/src/linkotron/__init__.py index 00a674c..1be8c89 100644 --- a/src/linkotron/__init__.py +++ b/src/linkotron/__init__.py @@ -44,7 +44,7 @@ class Patterns: ) COMMENT = re.compile( rf"^https://github.com/(?P{USERNAME})/(?P{REPO})/" - r"(pull|issues)/(?P\d+)#issuecomment-\d+/?$" + r"(pull|issues)/(?P\d+)#(issuecomment-\d+|discussion_r\d+)/?$" ) diff --git a/tests/test_linkotron.py b/tests/test_linkotron.py index becca26..1f7bbd7 100644 --- a/tests/test_linkotron.py +++ b/tests/test_linkotron.py @@ -24,6 +24,10 @@ "https://github.com/python/peps/pull/2399#issuecomment-1063409480", "python/peps#2399 (comment)", ), + ( + "https://github.com/python/peps/pull/2399#discussion_r823103351", + "python/peps#2399 (comment)", + ), ], ) def test_shorten(link: str, expected: str) -> None: