export const entireSelectionContainsMark = (mark, doc, fromPos, toPos) => {
  let onlyContainsMark = true;
  doc.nodesBetween(fromPos, toPos, node => {
    // Skip recursion once we've found text which doesn't include the mark
    if (!onlyContainsMark) {
      return false;
    }
    if (node.isText) {
      onlyContainsMark && (onlyContainsMark = !!(mark !== null && mark !== void 0 && mark.isInSet(node.marks)));
    }
  });
  return onlyContainsMark;
};