Fix preservation of foreign elements on paragraph merge

This behaviour was working prior to the merge paragraph operation being introduced. A new edge case was introduced related to cleaning up empty spans that caused this to regress.
So is this some kind of garbage collection? Empty spans per so are not a problem, just garbage, or is there a serious reason to do that here?