[Settings]Fix release cycle links in OOBE What's New page (#35801)

* Fix release cycle link in OOBE

Previously it would point to the 5ft last release instead.

* Adressed feedback
This commit is contained in:
Ionuț Manța 2024-11-08 17:38:33 +02:00 committed by GitHub
parent eed39e5d13
commit 3d306f6177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,11 +123,15 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
// Regex to remove installer hash sections from the release notes, since there'll be no Highlights section for hotfix releases. // Regex to remove installer hash sections from the release notes, since there'll be no Highlights section for hotfix releases.
Regex removeHotfixHashRegex = new Regex(RemoveHotFixInstallerHashesRegex, RemoveInstallerHashesRegexOptions); Regex removeHotfixHashRegex = new Regex(RemoveHotFixInstallerHashesRegex, RemoveInstallerHashesRegexOptions);
int counter = 0;
foreach (var release in latestReleases) foreach (var release in latestReleases)
{ {
releaseNotesHtmlBuilder.AppendLine("# " + release.Name); releaseNotesHtmlBuilder.AppendLine("# " + release.Name);
var notes = removeHashRegex.Replace(release.ReleaseNotes, "\r\n## Highlights"); var notes = removeHashRegex.Replace(release.ReleaseNotes, "\r\n## Highlights");
// Add a unique counter to [github-current-release-work] to distinguish each release,
// since this variable is used for all latest releases when they are merged.
notes = notes.Replace("[github-current-release-work]", $"[github-current-release-work{++counter}]");
notes = removeHotfixHashRegex.Replace(notes, string.Empty); notes = removeHotfixHashRegex.Replace(notes, string.Empty);
releaseNotesHtmlBuilder.AppendLine(notes); releaseNotesHtmlBuilder.AppendLine(notes);
releaseNotesHtmlBuilder.AppendLine(" "); releaseNotesHtmlBuilder.AppendLine(" ");