Hi
I have this HTML string which often has a lot of whitespaces
Example:
<p>All these words <br />
<strong>All</strong> <em>these</em> words
<pre> All these words</pre>
</p>
I need to remove them using JavaScript, and have come up with this regEx:
String.replace(/ {2,}/g, '');
Which seems to do the job with replacing unwanted whitespaces, but I want to preserve the whitespaces inside the PRE element.
Is this possible with a regex?