export function filterChildrenBetween(doc, from, to, predicate) {
  const results = [];
  doc.nodesBetween(from, to, (node, pos, _parent) => {
    if (predicate(node, pos, _parent)) {
      results.push({
        node,
        pos
      });
    }
  });
  return results;
}