We have moved to GitHub Issues
Created by Søren Kottal 16 Jun 2017, 18:57:48 Updated by Sebastiaan Janssen 31 Aug 2018, 17:36:36Tags: PR
In my head it doesn't really make sense that a method for creating html, doesn't return html.
This means, that right now we have to do @Html.Raw(Umbraco.ReplaceLineBreaksForHtml(Model.BodyText)) to get html in our views.
@sebastiaan @Søren.Kottal does it really makes sense to have all those ReplaceLineBreaksForHtml, StripHtml, Concatenate etc methods on UmbracoHelper?
The was I see it, UmbracoHelper helps to get access to umbraco (content/media etc). All the other methods feel like they should live as static methods or extension-methods on Url/Html-helper - at least that feels more natural for an Asp.Net Mvc-developer.
I agree, IMO it should be an extension method (string.ReplaceLineBreaksForHtml), and then also add a string.AutoAddParagraphs (like wordpress' wpautop function).
I think it's natural that an extension-merhod on String should return string, not (I)HtmlString. It feels off to me.
HtmlHelper.ReplaceNewlinesWithBreaks(string html) could/should do the trick.
In angular we also need special handling, when a string containing html is being bound.
Backwards Compatible: False
Fix Submitted: Pull request
Due in version: 8.0.0