mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 16:38:37 +00:00
Merge pull request #109 from LumaLivy/html-decode-strings
(Website) Decode html escape sequences in user comments
This commit is contained in:
commit
2d8fd1c2c9
1 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
|||
@using LBPUnion.ProjectLighthouse.Types
|
||||
@using LBPUnion.ProjectLighthouse.Types.Profiles
|
||||
@using LBPUnion.ProjectLighthouse.Types.Settings
|
||||
@using System.Web;
|
||||
@using System.IO;
|
||||
@model LBPUnion.ProjectLighthouse.Pages.UserPage
|
||||
|
||||
@{
|
||||
|
@ -92,9 +94,12 @@
|
|||
@foreach (Comment comment in Model.Comments!)
|
||||
{
|
||||
DateTimeOffset timestamp = DateTimeOffset.FromUnixTimeSeconds(comment.Timestamp / 1000);
|
||||
StringWriter messageWriter = new StringWriter();
|
||||
HttpUtility.HtmlDecode(comment.Message, messageWriter);
|
||||
String decodedMessage = messageWriter.ToString();
|
||||
<div>
|
||||
<b><a href="/user/@comment.PosterUserId">@comment.Poster.Username</a>: </b>
|
||||
<span>@comment.Message</span>
|
||||
<span>@decodedMessage</span>
|
||||
<p>
|
||||
<i>@timestamp.ToString("MM/dd/yyyy @ h:mm tt") UTC</i>
|
||||
</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue