2019-11-09 21:27:59 +00:00
|
|
|
using System.Text.RegularExpressions;
|
2019-11-13 00:46:10 +00:00
|
|
|
using DiscImageChef.CommonTypes.Metadata;
|
2019-11-09 21:27:59 +00:00
|
|
|
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), "
|
|
", "<br/>");
|
2019-11-13 00:46:10 +00:00
|
|
|
|
|
|
|
|
public static string EncodedMultiLineText(this IHtmlHelper<Mmc> helper, string text) =>
|
|
|
|
|
string.IsNullOrEmpty(text) ? string.Empty
|
|
|
|
|
: Regex.Replace(helper.Encode(text), "
|
|
", "<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), "
|
|
", "<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), "
|
|
", "<br/>");
|
2019-11-09 21:27:59 +00:00
|
|
|
}
|
|
|
|
|
}
|