Extract nested function definitions (#13625)

This commit is contained in:
Adam Turner authored and GitHub committed 2025-06-06 22:27:18 +01:00
1 parent 43c298b8e0
commit 77a0d6658b
12 files changed
+366 -335

No files matched your search

+5 -7
View File
@@ -297,16 +297,14 @@ def linkify_issues_in_changelog(
) -> None:
"""Linkify issue references like #123 in changelog to GitHub."""
if docname == 'changes':
def linkify(match: re.Match[str]) -> str:
url = 'https://github.com/sphinx-doc/sphinx/issues/' + match[1]
return f'`{match[0]} <{url}>`_'
linkified_changelog = re.sub(r'(?:PR)?#([0-9]+)\b', linkify, source[0])
linkified_changelog = re.sub(r'(?:PR)?#([0-9]+)\b', _linkify, source[0])
source[0] = linkified_changelog
def _linkify(match: re.Match[str], /) -> str:
return f'`{match[0]} <https://github.com/sphinx-doc/sphinx/issues/{match[1]}>`__'
REDIRECT_TEMPLATE = """
<html>
<head>