Merge pull request #2881 from skttl/patch-10

U4-10029 Umbraco.ReplaceLineBreaksForHtml should return an IHtmlString
This commit is contained in:
Sebastiaan Janssen
2018-08-31 19:42:57 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -20,9 +20,9 @@ namespace Umbraco.Web
/// </summary>
/// <param name="text">The text.</param>
/// <returns>The text with text line breaks replaced with html linebreaks (<br/>)</returns>
public string ReplaceLineBreaksForHtml(string text)
public HtmlString ReplaceLineBreaksForHtml(string text)
{
return text.Replace("\r\n", @"<br />").Replace("\n", @"<br />").Replace("\r", @"<br />");
return new HtmlString(text.Replace("\r\n", @"<br />").Replace("\n", @"<br />").Replace("\r", @"<br />"));
}
public HtmlString StripHtmlTags(string html, params string[] tags)

View File

@@ -875,7 +875,7 @@ namespace Umbraco.Web
/// </summary>
/// <param name="text">The text.</param>
/// <returns>The text with text line breaks replaced with html linebreaks (<br/>)</returns>
public string ReplaceLineBreaksForHtml(string text)
public IHtmlString ReplaceLineBreaksForHtml(string text)
{
return StringUtilities.ReplaceLineBreaksForHtml(text);
}