mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
25 lines
1.2 KiB
C#
25 lines
1.2 KiB
C#
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), "
|
|
", "<br/>");
|
|
|
|
public static string EncodedMultiLineText(this IHtmlHelper<Mmc> helper, string text) =>
|
|
string.IsNullOrEmpty(text) ? string.Empty
|
|
: Regex.Replace(helper.Encode(text), "
|
|
", "<br/>");
|
|
|
|
public static string EncodedMultiLineText(this IHtmlHelper<MmcSd> helper, string text) =>
|
|
string.IsNullOrEmpty(text) ? string.Empty
|
|
: Regex.Replace(helper.Encode(text), "
|
|
", "<br/>");
|
|
|
|
public static string EncodedMultiLineText(this IHtmlHelper<Scsi> helper, string text) =>
|
|
string.IsNullOrEmpty(text) ? string.Empty
|
|
: Regex.Replace(helper.Encode(text), "
|
|
", "<br/>");
|
|
}
|
|
} |