function regex_for_depth( depth ) {

        return new RegExp(
          // m[1] = indent, m[2] = list_type
          "(?:^(" + indent_re + "{0," + depth + "} {0,3})(" + any_list + ")\\s+)|" +
          // m[3] = cont
          "(^" + indent_re + "{0," + (depth-1) + "}[ ]{0,4})"
        );
      }
Markdown.dialects.Gruber

The default dialect that follows the rules set out by John Gruber's
markdown.pl as closely as possible. Well actually we follow the behaviour of
that script which in some places is not exactly what the syntax web page
says.