AI OnAI Off
I created a string extension method to workaround the issue. It's used on views like @Html.Raw(Model.Html.FixNbsp())
namespace Solita.Web.Utils.Common.Extensions { public static class StringExtensions { public static string FixNbsp(this string str) { // http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=114640 // TextArea string editor converts whitespaces to nbsp's after some update. // It happens if there are more than one whitespace in a row, the latter one's are replaced with nbsp's (charcode 160). const char nbspChar = '\u00A0'; return !string.IsNullOrEmpty(str) ? str.Replace(nbspChar, ' ') : string.Empty; } } }
Not nice, but works for now.
Hi
TextArea string editor has started converting whitespaces to nbsp's after some update. It happens if there are more than one whitespace in a row, the latter one's are replaced with nbsp's (charcode 160). Perhaps a nice feature if you'r using the strings only on your views, but not so nice when you'r using them for embedded html or system configuration.
I think it's a terrible change and should be reverted to save the text as it was written. But meanwhile I'd be happy to know if there are nice and clean workarounds.