Preserve non-breaking spaces in component properties

Multi-line component properties sanitize their input, including removing non-breaking spaces. This components in certain cases. Non-breaking spaces are just another unicode character and not a security risk.

Components properties inherently limit formatting options of elements, but not all of them. Currently if you link a paragraph to a multi-line component property it will preserve line breaks allowing you to add multiple paragraphs to a single paragraph element. This makes sense when the number of paragraphs is not known in advance, but a rich text field is not restrictive enough.

Similarly, there is no way of knowing in advance how text is going to wrap as it depends on viewport width, user font size settings etc. But what if there are certain terms that we don't want to wrap. For example, the marketing department does not want the name of our product spread out over multiple lines. Normally we can use a non-breaking space as a very simple solution.

Why is this one unicode character stripped out when the NL and CR characters are preserved?

  • Justin Everett
  • Oct 16 2024