Skip to content

Commit feab5fb

Browse files
Add Sphinx markup for CVEs in Changelog entries
1 parent 9124802 commit feab5fb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎Doc/tools/extensions/misc_news.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
gh_issue_re: Final[re.Pattern[str]] = re.compile(
3131
"gh-(?:issue-)?([0-9]+)", re.ASCII | re.IGNORECASE
3232
)
33+
cve_re: Final[re.Pattern[str]] = re.compile(
34+
"CVE-([0-9]{4}-[0-9]{4,})", re.ASCII | re.IGNORECASE
35+
)
3336
whatsnew_re: Final[re.Pattern[str]] = re.compile(
3437
r"^what's new in (.*?)\??$", re.ASCII | re.IGNORECASE | re.MULTILINE
3538
)
@@ -59,6 +62,7 @@ def run(self) -> list[Node]:
5962
news_text = bpo_issue_re.sub(r":issue:`\1`", news_text)
6063
# Fallback handling for GitHub issues
6164
news_text = gh_issue_re.sub(r":gh:`\1`", news_text)
65+
news_text = cve_re.sub(r":cve:`\1`", news_text)
6266
news_text = whatsnew_re.sub(r"\1", news_text)
6367

6468
self.state_machine.insert_input(news_text.splitlines(), str(news_file))

0 commit comments

Comments
 (0)