So, here is normal text: just your standard paragraph.

![Normal Text](https://i.stack.imgur.com/Kc8Uj.png)

I have javascript that will insert a span around selected text (for highlighting purposes).
The problem is that when I remove the span, the nice text block becomes chunky, and malformed:

![enter image description here](https://i.stack.imgur.com/2v5Ea.png)

How do I restore the block of text to its original state?