function next (prev, current, isPre) {
  if ((prev && prev.parentNode === current) || isPre(current)) {
    return current.nextSibling || current.parentNode
  }

  return current.firstChild || current.nextSibling || current.parentNode
}
next(prev, current, isPre) returns the next node in the sequence, given the
current and previous nodes.

@param {Node} prev
@param {Node} current
@param {Function} isPre
@return {Node}