I'm using the following JS code to replace one or more consecutive whitespace characters with a single space character:
textContent.replace(/\s+/g, ' ');
I would like to modify the regex to ignore non-breaking spaces.
For example, this:
ABC \u00a0\u00a0XYZ
Should result in this:
ABC \u00a0\u00a0XYZ