mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-25 22:50:22 -05:00
Extract nested function definitions (#13625)
This commit is contained in:
1 parent
43c298b8e0
commit
77a0d6658b
12 files changed
+366
-335
No files matched your search
+5
-7
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user