code: 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;
  }
docs: getRange
  get current range
  @returns {Range}
  @ignore