Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

399 B
Raw Blame
using System.Net;

namespace Grand.SharedKernel.Extensions;

public static class FormatText
{
    public static string ConvertText(string text)
    {
        if (string.IsNullOrEmpty(text))
            return string.Empty;

        text = WebUtility.HtmlEncode(text);

        text = text.Replace("\r\n", "<br />");
        text = text.Replace("\t", "&nbsp;&nbsp;");

        return text;
    }
}