Ensure selectable container fix

This fixes the issue when inserting a node with a child node but no text content, a```BR``` is added to the wrong place.
E.g. ```<p><b></b></p>``` => ```<p><b></b><br></p>``` when it should be ```<p><b><br></b></p>```
> node's text content when trimmed is empty

This is what I'm struggling to read. I guess we're actually matching "node has no non-whitespace characters". When you have to reverse engineer something to understand what it's doing and why, it's helpful to have code self-documenting using variables, e.g. `nodeHasNoNonWhitespaceChars`.