diff options
author | Dong-hee Na <donghee.na@python.org> | 2022-05-08 13:21:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 13:21:05 (GMT) |
commit | 480234488cb61fc93a67ad257fe347adc3e9edaa (patch) | |
tree | 1296dc96449207766b95fa849b264188ba663f5e /Doc/tools | |
parent | 4a2337fe33a8f0174cad1725c2e84e039286abe5 (diff) | |
download | cpython-480234488cb61fc93a67ad257fe347adc3e9edaa.zip cpython-480234488cb61fc93a67ad257fe347adc3e9edaa.tar.gz cpython-480234488cb61fc93a67ad257fe347adc3e9edaa.tar.bz2 |
[3.9] gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449). (GH-92458)
Diffstat (limited to 'Doc/tools')
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 6c81986..4575300 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -391,7 +391,8 @@ class DeprecatedRemoved(Directive): # Support for including Misc/NEWS -issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)') +issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)', re.I) +gh_issue_re = re.compile('(?:gh-issue-|gh-)([0-9]+)', re.I) whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$") @@ -418,9 +419,9 @@ class MiscNews(Directive): text = 'The NEWS file is not available.' node = nodes.strong(text, text) return [node] - content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/' - r'issue?@action=redirect&bpo=\1>`__', - content) + content = issue_re.sub(r':issue:`\1`', content) + # Fallback handling for the GitHub issue + content = gh_issue_re.sub(r':gh:`\1`', content) content = whatsnew_re.sub(r'\1', content) # remove first 3 lines as they are the main heading lines = ['.. default-role:: obj', ''] + content.splitlines()[3:] |