Skip to content

Commit fd86654

Browse files
committed
Simplify :gh: ref replacement @ pkg description
1 parent 7214d1e commit fd86654

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packaging/pep517_backend/_transformers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ def sanitize_rst_roles(rst_source_text: str) -> str:
6767
)
6868

6969
gh_role_regex = r"""(?x)
70-
:gh:`(?P<gh_slug>[^`]+)(?:\s+(.*))?`
70+
:gh:`(?P<gh_slug>[^`<]+)(?:\s+([^`]*))?`
7171
"""
72-
gh_substitution_pattern = (
73-
r"`GitHub: \g<gh_slug> <https://github.com/\g<gh_slug>>`__"
74-
)
72+
gh_substitution_pattern = r"GitHub: ``\g<gh_slug>``"
7573

7674
meth_role_regex = r"""(?x)
7775
(?::py)?:meth:`~?(?P<rendered_text>[^`<]+)(?:\s+([^`]*))?`

0 commit comments

Comments
 (0)