Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix up the match and substitution regexes
Make the prefix match non-capturing and fix a bug where a backslash was left into the substitution.
  • Loading branch information
brettcannon authored Feb 10, 2017
commit 54011640183be0f18eebe2da7b0e3e81160dbb17
4 changes: 2 additions & 2 deletions Doc/tools/extensions/pyspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def run(self):

# Support for including Misc/NEWS

issue_re = re.compile('([Ii]ssue #|bpo-)([0-9]+)')
issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)')
whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")


Expand Down Expand Up @@ -253,7 +253,7 @@ def run(self):
text = 'The NEWS file is not available.'
node = nodes.strong(text, text)
return [node]
content = issue_re.sub(r'`\bpo-\2 <https://bugs.python.org/\2>`__',
content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/\1>`__',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest making it https://bugs.python.org/issue\1 to avoid the redirect through https://www.python.org/sf/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

content)
content = whatsnew_re.sub(r'\1', content)
# remove first 3 lines as they are the main heading
Expand Down