Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (29 sloc) 1.01 KB
using System.Text.RegularExpressions;
namespace ToSic.Razor.Blade
{
public static partial class Tags
{
/// <summary>
/// Convert \n into &lt;br&gt; line-breaks
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string Nl2Br(string value)
=> Text.Nl2X(value, "<br>");
private static readonly Regex RelpacerBr = TagReplacer.Replacer("br");
/// <summary>
/// Convert &lt;br&gt; and &lt;br/&gt; into line-breaks (\n)
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string Br2Nl(string value)
=> RelpacerBr.Replace(value, "\n");
/// <summary>
/// Convert &lt;br&gt; and &lt;br/&gt; into line-breaks
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string Br2Space(string value)
=> RelpacerBr.Replace(value, " ");
}
}
You can’t perform that action at this time.