diff options
author | Dong-hee Na <donghee.na@python.org> | 2022-05-12 15:42:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 15:42:22 (GMT) |
commit | a5ed8947037da5f9d50efd17f70546986dd46c74 (patch) | |
tree | fa9cdd8c413f9fc7ee06925799b8688c6c2b34dd /Doc | |
parent | 10bc004642786662324a2b0fc9a804e1110f582b (diff) | |
download | cpython-a5ed8947037da5f9d50efd17f70546986dd46c74.zip cpython-a5ed8947037da5f9d50efd17f70546986dd46c74.tar.gz cpython-a5ed8947037da5f9d50efd17f70546986dd46c74.tar.bz2 |
[3.8] gh-92448: Update the documentation builder to render the GitHub… (GH-92605)
(cherry picked from commit 45e1721d100bab09510ccf9da49f14ca5cc268f4)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
Diffstat (limited to 'Doc')
-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 cd9144e..359d764 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -390,7 +390,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 (.*?)\??$") @@ -417,9 +418,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:] |