JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="inputPane" cols="80" rows="40" class="pane">
<p>
some text here...
</p>
<p>
more text here...
</p>
</textarea>
JavaScript
$(document).ready(function(){
$('.pane').val(function(i,v){
return v.replace(/\s+/g,' ').replace(/>(\s)</g,'>\n<');
});
})