Files
Aaru.Server/DiscImageChef.Server/Core/HtmlHelpers.cs

25 lines
1.2 KiB
C#
Raw Normal View History

using System.Text.RegularExpressions;
using DiscImageChef.CommonTypes.Metadata;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace DiscImageChef.Server.Core
{
public static class HtmlHelpers
{
public static string EncodedMultiLineText(this IHtmlHelper<CommonTypes.Metadata.Ata> helper, string text) =>
string.IsNullOrEmpty(text) ? string.Empty
: Regex.Replace(helper.Encode(text), "&#xD;&#xA;|&#xA;|&#xD;", "<br/>");
public static string EncodedMultiLineText(this IHtmlHelper<Mmc> helper, string text) =>
string.IsNullOrEmpty(text) ? string.Empty
: Regex.Replace(helper.Encode(text), "&#xD;&#xA;|&#xA;|&#xD;", "<br/>");
2019-11-16 01:52:17 +00:00
public static string EncodedMultiLineText(this IHtmlHelper<MmcSd> helper, string text) =>
string.IsNullOrEmpty(text) ? string.Empty
: Regex.Replace(helper.Encode(text), "&#xD;&#xA;|&#xA;|&#xD;", "<br/>");
2019-11-17 18:19:38 +00:00
public static string EncodedMultiLineText(this IHtmlHelper<Scsi> helper, string text) =>
string.IsNullOrEmpty(text) ? string.Empty
: Regex.Replace(helper.Encode(text), "&#xD;&#xA;|&#xA;|&#xD;", "<br/>");
}
}