mirror of
https://github.com/ppy/osu
synced 2025-01-11 00:29:30 +00:00
Merge pull request #6178 from Game4all/fix-html-unescaping
Fix escaped html strings not being unescaped in changelog entries.
This commit is contained in:
commit
35f0e07007
@ -68,6 +68,34 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
changelog.ShowListing();
|
changelog.ShowListing();
|
||||||
changelog.Show();
|
changelog.Show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddStep(@"Ensure HTML string unescaping", () =>
|
||||||
|
{
|
||||||
|
changelog.ShowBuild(new APIChangelogBuild
|
||||||
|
{
|
||||||
|
Version = "2019.920.0",
|
||||||
|
DisplayVersion = "2019.920.0",
|
||||||
|
UpdateStream = new APIUpdateStream
|
||||||
|
{
|
||||||
|
Name = "Test",
|
||||||
|
DisplayName = "Test"
|
||||||
|
},
|
||||||
|
ChangelogEntries = new List<APIChangelogEntry>
|
||||||
|
{
|
||||||
|
new APIChangelogEntry
|
||||||
|
{
|
||||||
|
Category = "Testing HTML strings unescaping",
|
||||||
|
Title = "Ensuring HTML strings are being unescaped",
|
||||||
|
MessageHtml = """"This text should appear triple-quoted""" >_<",
|
||||||
|
GithubUser = new APIChangelogUser
|
||||||
|
{
|
||||||
|
DisplayName = "Dummy",
|
||||||
|
OsuUsername = "Dummy",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Changelog
|
namespace osu.Game.Overlays.Changelog
|
||||||
{
|
{
|
||||||
@ -149,7 +150,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
};
|
};
|
||||||
|
|
||||||
// todo: use markdown parsing once API returns markdown
|
// todo: use markdown parsing once API returns markdown
|
||||||
message.AddText(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty), t =>
|
message.AddText(WebUtility.HtmlDecode(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty)), t =>
|
||||||
{
|
{
|
||||||
t.Font = fontSmall;
|
t.Font = fontSmall;
|
||||||
t.Colour = new Color4(235, 184, 254, 255);
|
t.Colour = new Color4(235, 184, 254, 255);
|
||||||
|
Loading…
Reference in New Issue
Block a user