diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-05-08 13:05:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 13:05:01 (GMT) |
commit | d0d22ca9fb6afc3f01d1d2dc18a5e1eaba2988fa (patch) | |
tree | 9dc291ccd4721c77d64625903fa3579867e0cfa2 /Doc/tools | |
parent | 14bd6df0940e005c57745abf550c83f046de9a03 (diff) | |
download | cpython-d0d22ca9fb6afc3f01d1d2dc18a5e1eaba2988fa.zip cpython-d0d22ca9fb6afc3f01d1d2dc18a5e1eaba2988fa.tar.gz cpython-d0d22ca9fb6afc3f01d1d2dc18a5e1eaba2988fa.tar.bz2 |
gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449)
(cherry picked from commit 45e1721d100bab09510ccf9da49f14ca5cc268f4)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
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 b02e31d..bdcfe9a 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -429,7 +429,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 (.*?)\??$") @@ -456,9 +457,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:] |