summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ci/parse_relnotes.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ci/parse_relnotes.py b/ci/parse_relnotes.py
index d19e6d60..ba5089eb 100644
--- a/ci/parse_relnotes.py
+++ b/ci/parse_relnotes.py
@@ -84,6 +84,14 @@ def refind(regex, text):
else:
return None
+
+def fix_ref_links(text, version):
+ """Find links to .rst files, and make them full RTFD links."""
+ def new_link(m):
+ return f"](https://coverage.readthedocs.io/en/{version}/{m[1]}.html{m[2]})"
+ return re.sub(r"\]\((\w+)\.rst(#.*?)\)", new_link, text)
+
+
def relnotes(mdlines):
r"""Yield (version, text) pairs from markdown lines.
@@ -97,6 +105,7 @@ def relnotes(mdlines):
if version:
prerelease = any(c in version for c in "abc")
when = refind(r"\d+-\d+-\d+", htext)
+ text = fix_ref_links(text, version)
yield {
"version": version,
"text": text,