function getSelection () {
  if (window.getSelection) {
    const sel = window.getSelection()
    if (sel.getRangeAt && sel.rangeCount) {
      return sel.getRangeAt(0)
    }
  }
  return null
}
Get text selection
http://stackoverflow.com/questions/4687808/contenteditable-selected-text-save-and-restore
@return {Range | TextRange | null} range