SharePoint 2013 Content Editor – ​ zero width space characters

Sometimes, the content editor web part of SharePoint 2013 adds unwanted characters to the text within it. You check once, twice, remove any unnecessary line breaks, spaces etc., but after saving or in the HTML source of the page you find these weird characters: ​ – the zero width spaces (& #8203;)

They can mess up your CSS layout, and frankly, I have not found a solution to force SharePoint not to insert them.

One possible workaround would be to remove them with a library like jQuery, e.g.

$(‘.ms-rtestate-field’).each(function(index,element)  {
var theeditor = $(element);
$(theeditor).html($(theeditor).html().replace(/\u200B/g,”));
});

The selector applies to the content editor webpart of SP2013.

Hope this helps.
Lukasz

~ by Łukasz on 22 March 2016.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: