diff --git a/src/Umbraco.Web/HtmlStringUtilities.cs b/src/Umbraco.Web/HtmlStringUtilities.cs index 24a643b5b0..1737aca365 100644 --- a/src/Umbraco.Web/HtmlStringUtilities.cs +++ b/src/Umbraco.Web/HtmlStringUtilities.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; using System.Web; +using System.Text.RegularExpressions; using HtmlAgilityPack; namespace Umbraco.Web @@ -23,7 +24,7 @@ namespace Umbraco.Web /// The text with text line breaks replaced with html linebreaks (
)
public string ReplaceLineBreaksForHtml(string text) { - return text.Replace("\n", "
\n"); + return Regex.Replace(text, @"(\r\n?|\n)", "
$0"); } public HtmlString StripHtmlTags(string html, params string[] tags) @@ -241,4 +242,4 @@ namespace Umbraco.Web } } } -} \ No newline at end of file +}