Remove &nbsp from summernote

Have a summernote field, at times my staff will paste information from another site. Copies the format without any issues. However, upon saving, I will see " &nbsp" in some of the data. All other tags are fine so I cant use the strip tags and I also cannot use the replace feature. Any thoughts?

Obviously I could have them use the code view in summernote and remove it but thats an extra step I doubt anyone will do.

Those are generally inserted when the text has double spaces between words or sentences. Since HTML won’t accept two spaces in a row it inserts the &nbsp (Non-breaking space).

It won’t hurt anything to leave it there. If staff just look for content that has two spaces in a row and delete one it should remove it. It may just remove the blank space and leave that code in there though.

But as I mentioned, it doesn’t hurt or effect anything to leave it there.

1 Like

We use TinyMCE’s cloud version for sites that have a lot of copy and paste into rich test fields, as https://www.tiny.cloud does an amazing job of cleaning up the pasted in messes and users don’t have to know anything.

2 Likes