dist/bundle.js
/* Create a list-item using sane mechanics. */
Create a list-item using sane mechanics.
Create a list - item using sane mechanics .
function normalListItem(ctx, value, position) {
  var offsets = ctx.offset;
  var line = position.line;
  var max;
  var bullet;
  var rest;
  var lines;
  var trimmedLines;
  var index;
  var length;
  value = value.replace(EXPRESSION_BULLET, replacer);
  lines = value.split(C_NEWLINE);
  trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE);
  trimmedLines[0] = rest;
  offsets[line] = (offsets[line] || 0) + bullet.length;
  line++;
  index = 0;
  length = lines.length;
  while (++index < length) {
    offsets[line] = (offsets[line] || 0) +
      lines[index].length - trimmedLines[index].length;
    line++;
  }
  return trimmedLines.join(C_NEWLINE);
  function replacer($0, $1, $2, $3, $4) {
    bullet = $1 + $2 + $3;
    rest = $4;
    if (Number($2) < 10 && bullet.length % 2 === 1) {
      $2 = C_SPACE + $2;
    }
    max = $1 + repeat(C_SPACE, $2.length) + $3;
    return max + rest;
  }
}
function normalListItem ( ctx , value , position ) { var offsets = ctx . offset ; var line = position . line ; var max ; var bullet ; var rest ; var lines ; var trimmedLines ; var index ; var length ; value = value . replace ( EXPRESSION_BULLET , replacer ) ; lines = value . split ( C_NEWLINE ) ; trimmedLines = removeIndent ( value , getIndent ( max ) . indent ) . split ( C_NEWLINE ) ; trimmedLines [ 0 ] = rest ; offsets [ line ] = ( offsets [ line ] || 0 ) + bullet . length ; line ++ ; index = 0 ; length = lines . length ; while ( ++ index < length ) { offsets [ line ] = ( offsets [ line ] || 0 ) + lines [ index ] . length - trimmedLines [ index ] . length ; line ++ ; } return trimmedLines . join ( C_NEWLINE ) ; function replacer ( $0 , $1 , $2 , $3 , $4 ) { bullet = $1 + $2 + $3 ; rest = $4 ; if ( Number ( $2 ) < 10 && bullet . length % 2 === 1 ) { $2 = C_SPACE + $2 ; } max = $1 + repeat ( C_SPACE , $2 . length ) + $3 ; return max + rest ; } }
Create a list-item using sane mechanics.
Create a list - item using sane mechanics .
/* Remove the list-item’s bullet. */ /* We replaced the initial bullet with something
   * else above, which was used to trick
   * `removeIndentation` into removing some more
   * characters when possible.  However, that could
   * result in the initial line to be stripped more
   * than it should be. */ /* Make sure that the first nine numbered list items
     * can indent with an extra space.  That is, when
     * the bullet did not receive an extra final space. */