We have helper functions in our project that serve to format values to human-readable and good-looking strings.
Due to design requirements the functions return text containing various whitespace characters (e.g. U+2009 «thin space» or U+200A «hair space»).
But the same design requirements require that the formatted text to be non-breaking.
So here we are.
- We cannot use U+00A0 «no-break space» because it has inappropriate width.
- We use required by design spaces, but they are may be used as a line-break.
We can return from these helpers HTML, not plain strings (and then apply white-space: nowrap CSS to the HTML). But this requires to refactor all code that uses the helpers and complicates using the formatted values in components (we use React).
So this is the question: how to make any Unicode whitespace character non-breaking without HTML/CSS?
There is plenty of features in Unicode to combine characters into clusters and control the visual properties of text: combining characters and marks, joiners, selectors, modifiers, and so on. Maybe at least one of this variety makes it possible to make any whitespace character non-breaking? :)
Thank you.