code: function getMarkLength(markType, nodes) {
    let length = 0;
    while (nodes[length] && nodes[length].marks.includes(markType)) {
      ++length;
    }
    return { markType, length };
  }
docs: Get the number of consecutive Slate nodes containing a given mark beginning
  from the first received node.