Remove all nbsp?

Is there a way to let users insert text that doesn't get a nbsp between every single word?

Also remove all the

tags? I have each p as a field and want to wrap each slice in my own

This fixed it but seems really dumb...

html_serializer = Prismic.html_serializer do |element, html|
  html = html.gsub("\u00A0", ' ') # this line

  ...
end
<%= slice.non_repeat['text'].as_html(link_resolver(), html_serializer).html_safe %>

Hey Xander, thank you for reaching out!

This is tricky because the fields in your documents are going to save anything that you add in them. Sometimes non-breaking spaces appear when they're copied and pasted from the web. An easy way to remove these unwanted characters is by copying the desired text from a Word document, so first, copy the text where they are contained into a text editor (even though this will strip all formatting) and then copy back into the Prismic doc.

For some reason even just typing plain text, or pasting from VS Code and hitting "clean" after highlighting it all, still leaves a   everywhere. Is that normal?

and before Vs code where did you take the text from?

Typed it all out, and I have invisible characters visible (OCD lol) and they're not there. I even tried manually typing it all into Prismic and following the guides gives me nbsp between everything. Default rich text code and default html sanitizer.

You manually added text into Prismic and the response added &nbsp characters? that's really weird.

Could you please send me the URL of your repo in a private message, as well as the name of the document and the field where you are seeing this?

This issue has been closed due to inactivity. Flag to reopen.