Fix text wrap and symbols not being decoded (#324)

This commit is contained in:
Josh 2022-06-14 01:43:28 -05:00 committed by GitHub
parent c0df2c302f
commit 7c13d51024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View file

@ -1,3 +1,4 @@
@using System.Web
@using LBPUnion.ProjectLighthouse
@using LBPUnion.ProjectLighthouse.Configuration
@using LBPUnion.ProjectLighthouse.PlayerData
@ -10,8 +11,8 @@
await using Database database = new();
string slotName = string.IsNullOrEmpty(Model.Name) ? "Unnamed Level" : Model.Name;
string slotName = HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model!.Name) ? "Unnamed Level" : Model.Name);
bool isMobile = (bool?)ViewData["IsMobile"] ?? false;
bool mini = (bool?)ViewData["IsMini"] ?? false;

View file

@ -4,15 +4,14 @@
@using LBPUnion.ProjectLighthouse.Configuration
@using LBPUnion.ProjectLighthouse.Extensions
@using LBPUnion.ProjectLighthouse.PlayerData.Reviews
@using LBPUnion.ProjectLighthouse.Types
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.SlotPage
@{
Layout = "Layouts/BaseLayout";
Model.ShowTitleInPage = false;
Model.Title = Model.Slot?.Name ?? "";
Model.Description = Model.Slot?.Description ?? "";
Model.Title = HttpUtility.HtmlDecode(Model.Slot?.Name ?? "");
Model.Description = HttpUtility.HtmlDecode(Model.Slot?.Description ?? "");
bool isMobile = this.Request.IsMobile();
}
@ -38,15 +37,14 @@
<div class="eight wide column">
<div class="ui blue segment">
<h2>Description</h2>
<p>@HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description)</p>
<p style="overflow-wrap: anywhere">@HttpUtility.HtmlDecode(string.IsNullOrEmpty(Model.Slot?.Description) ? "This level has no description." : Model.Slot.Description)</p>
</div>
</div>
<div class="eight wide column">
<div class="ui red segment">
<h2>Tags</h2>
@{
string[] authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? new string[]
{};
string[] authorLabels = Model.Slot?.AuthorLabels.Split(",") ?? new string[]{};
if (authorLabels.Length == 1) // ..?? ok c#
{
<p>This level has no tags.</p>

View file

@ -142,9 +142,11 @@ public class User
[JsonIgnore]
public string BannedReason { get; set; }
#nullable enable
[JsonIgnore]
public string? ApprovedIPAddress { get; set; }
#nullable disable
public string Serialize(GameVersion gameVersion = GameVersion.LittleBigPlanet1)
{

View file

@ -27,6 +27,7 @@ canvas.hide-subjects {
.card {
display: flex;
overflow-wrap: anywhere;
width: 100%;
}