function count_lines( str ) {
    var n = 0,
        i = -1;
    while ( ( i = str.indexOf("\n", i + 1) ) !== -1 )
      n++;
    return n;
  }
parse( markdown, [dialect] ) -> JsonML
 - markdown (String): markdown string to parse
 - dialect (String | Dialect): the dialect to use, defaults to gruber

 Parse `markdown` and return a markdown document as a Markdown.JsonML tree.