function getSelectionOffset () {
  const range = getSelection()

  if (range && 'startOffset' in range && 'endOffset' in range &&
      range.startContainer && (range.startContainer === range.endContainer)) {
    return {
      startOffset: range.startOffset,
      endOffset: range.endOffset,
      container: range.startContainer.parentNode
    }
  }

  return null
}
Get selected text range
@return {Object} params  object containing parameters:
                             {Number}  startOffset
                             {Number}  endOffset
                             {Element} container  HTML element holding the
                                                  selected text element
                         Returns null if no text selection is found