function prepareList(slice) {
    var length = slice.length - 1 // Skip close.
    var index = 0 // Skip open.
    var containerBalance = 0
    var loose
    var atMarker
    var event

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

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

        if (event[0] === 'enter') {
          containerBalance++
        } else {
          containerBalance--
        }
      } else if (event[1].type === types.listItemPrefix) {
        if (event[0] === 'exit') {
          atMarker = true
        }
      } else if (event[1].type === types.linePrefix);
      else if (event[1].type === types.lineEndingBlank) {
        if (event[0] === 'enter' && !containerBalance) {
          if (atMarker) {
            atMarker = undefined
          } else {
            loose = true
          }
        }
      } else {
        atMarker = undefined
      }
    }

    slice[0][1]._loose = loose
  }
// Figure out whether lists are loose or not.
Figure out whether lists are loose or not.
Figure out whether lists are loose or not .
function prepareList(slice) {
    var length = slice.length - 1 
    var index = 0 
    var containerBalance = 0
    var loose
    var atMarker
    var event
    while (++index < length) {
      event = slice[index]
      if (event[1]._container) {
        atMarker = undefined
        if (event[0] === 'enter') {
          containerBalance++
        } else {
          containerBalance--
        }
      } else if (event[1].type === types.listItemPrefix) {
        if (event[0] === 'exit') {
          atMarker = true
        }
      } else if (event[1].type === types.linePrefix);
      else if (event[1].type === types.lineEndingBlank) {
        if (event[0] === 'enter' && !containerBalance) {
          if (atMarker) {
            atMarker = undefined
          } else {
            loose = true
          }
        }
      } else {
        atMarker = undefined
      }
    }
    slice[0][1]._loose = loose
  }
function prepareList ( slice ) { var length = slice . length - 1 var index = 0 var containerBalance = 0 var loose var atMarker var event while ( ++ index < length ) { event = slice [ index ] if ( event [ 1 ] . _container ) { atMarker = undefined if ( event [ 0 ] === 'enter' ) { containerBalance ++ } else { containerBalance -- } } else if ( event [ 1 ] . type === types . listItemPrefix ) { if ( event [ 0 ] === 'exit' ) { atMarker = true } } else if ( event [ 1 ] . type === types . linePrefix ) ; else if ( event [ 1 ] . type === types . lineEndingBlank ) { if ( event [ 0 ] === 'enter' && ! containerBalance ) { if ( atMarker ) { atMarker = undefined } else { loose = true } } } else { atMarker = undefined } } slice [ 0 ] [ 1 ] . _loose = loose }
Figure out whether lists are loose or not.
Figure out whether lists are loose or not .
// Skip close. // Skip open.