function getRange() {
  const selection = window.getSelection();
  let range;

  if (selection && selection.rangeCount) {
    range = selection.getRangeAt(0).cloneRange();
  } else {
    range = document.createRange();
    range.selectNodeContents(this.preview.$el[0]);
    range.collapse(true);
  }

  return range;
}
function getRange() {
  const selection = window.getSelection();
  let range;

  if (selection && selection.rangeCount) {
    range = selection.getRangeAt(0).cloneRange();
  } else {
    range = document.createRange();
    range.selectNodeContents(this.preview.$el[0]);
    range.collapse(true);
  }

  return range;
}
function getRange ( ) { const selection = window . getSelection ( ) ; let range ; if ( selection && selection . rangeCount ) { range = selection . getRangeAt ( 0 ) . cloneRange ( ) ; } else { range = document . createRange ( ) ; range . selectNodeContents ( this . preview . $el [ 0 ] ) ; range . collapse ( true ) ; } return range ; }
getRange
get current range
@returns {Range}
@ignore
getRange get current range
Get the range of the preview element