Skip to content

Commit a315668

Browse files
committed
Fix format
1 parent db9ea63 commit a315668

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

web/pages/news.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ export default function WhatsNew() {
6666
</span>
6767
</div>
6868
<div className="mt-4 prose text-ink-1000">
69-
<ReactMarkdown>{release.body || "_No release notes provided._"}</ReactMarkdown>
69+
<ReactMarkdown>
70+
{formatPullLinks(release.body || "_No release notes provided._")}
71+
</ReactMarkdown>
7072
</div>
7173
<Link href={release.html_url}>View on GitHub</Link>
7274
</div>
@@ -76,3 +78,15 @@ export default function WhatsNew() {
7678
</PageBase>
7779
)
7880
}
81+
82+
function formatPullLinks(text = "") {
83+
return text
84+
.replace('CompassMeet', 'CompassConnections')
85+
.replace(
86+
/https:\/\/github\.com\/CompassConnections\/Compass\/pull\/(\d+)/g,
87+
(_, num) => `[#${num}](https://github.com/CompassConnections/Compass/pull/${num})`)
88+
.replace(
89+
/https:\/\/github\.com\/CompassConnections\/Compass\/compare\/([\w.-]+\.\.\.[\w.-]+)/g,
90+
(_, range) => `[${range}](https://github.com/CompassConnections/Compass/compare/${range})`)
91+
}
92+

0 commit comments

Comments
 (0)