Skip to content

Commit

Permalink
[OOBE][What's New]Hide hotfix installer hashes (#25418)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Apr 12, 2023
1 parent 4e4caf4 commit 7107a76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/settings-ui/Settings.UI/OOBE/Views/OobeWhatsNew.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public OobeWhatsNew()
/// Regex to remove installer hash sections from the release notes.
/// </summary>
private const string RemoveInstallerHashesRegex = @"(\r\n)+## Installer Hashes(\r\n.*)+## Highlights";
private const RegexOptions RemoveInstallerHashesRegexOptions = RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;
private const string RemoveHotFixInstallerHashesRegex = @"(\r\n)+## Installer Hashes(\r\n.*)+$";
private const RegexOptions RemoveInstallerHashesRegexOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;

private static async Task<string> GetReleaseNotesMarkdown()
{
Expand Down Expand Up @@ -86,10 +87,14 @@ private static async Task<string> GetReleaseNotesMarkdown()
// Regex to remove installer hash sections from the release notes.
Regex removeHashRegex = new Regex(RemoveInstallerHashesRegex, RemoveInstallerHashesRegexOptions);

// 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);

foreach (var release in latestReleases)
{
releaseNotesHtmlBuilder.AppendLine("# " + release.Name);
var notes = removeHashRegex.Replace(release.ReleaseNotes, "\r\n## Highlights");
notes = removeHotfixHashRegex.Replace(notes, string.Empty);
releaseNotesHtmlBuilder.AppendLine(notes);
releaseNotesHtmlBuilder.AppendLine("&nbsp;");
}
Expand Down

0 comments on commit 7107a76

Please sign in to comment.