code: function (ed) {
        // Adjust selection so that a end container with a end offset of zero is not included in the selection
        // as this isn't visible to the user.
        var rng = RangeNormalizer.normalize(ed.selection.getRng());
        var start = rng.startContainer;
        var end = rng.endContainer;
  
        if (start !== end && rng.endOffset === 0) {
          var newEnd = findSelectionEnd(start, end);
          var endOffset = newEnd.nodeType === 3 ? newEnd.data.length : newEnd.childNodes.length;
  
          rng.setEnd(newEnd, endOffset);
        }
  
        return rng;
      }
docs: This converts: <p>[a</p><p>]b</p> -> <p>[a]</p><p>b</p>