function prepareList(slice) {
    const length = slice.length
    let index = 0 // Skip open.
    let containerBalance = 0
    let loose = false
    /** @type {boolean | undefined} */
    let atMarker

    while (++index < length) {
      const event = slice[index]

      if (event[1]._container) {
        atMarker = undefined

        if (event[0] === 'enter') {
          containerBalance++
        } else {
          containerBalance--
        }
      } else
        switch (event[1].type) {
          case types.listItemPrefix: {
            if (event[0] === 'exit') {
              atMarker = true
            }

            break
          }

          case types.linePrefix: {
            // Ignore

            break
          }

          case types.lineEndingBlank: {
            if (event[0] === 'enter' && !containerBalance) {
              if (atMarker) {
                atMarker = undefined
              } else {
                loose = true
              }
            }

            break
          }

          default: {
            atMarker = undefined
          }
        }
    }

    slice[0][1]._loose = loose
  }
Figure out whether lists are loose or not.

@param {ReadonlyArray<Event>} slice
@returns {undefined}