markdown-js =========== Yet another markdown parser, this time for JavaScript. There's a few options that precede this project but they all treat markdown to HTML conversion as a single step process. You pass markdown in and get HTML out, end of story. We had some pretty particular views on how the process should actually look, which include: * producing well-formed HTML. This means that em and strong nesting is important, as is the ability to output as both HTML and XHTML * having an intermediate representation to allow processing of parsed data (we in fact have two, both [JsonML]: a markdown tree and an HTML tree) * being easily extensible to add new dialects without having to rewrite the entire parsing mechanics * having a good test suite. The only test suites we could find tested massive blocks of input, and passing depended on outputting the HTML with exactly the same whitespace as the original implementation [JsonML]: http://jsonml.org/ "JSON Markup Language" ## Installation Just the `markdown` library: npm install markdown Also install `md2html` to `/usr/local/bin` (or wherever) npm install -g markdown ## Usage The simple way to use it with CommonJS is: var input = "# Heading\n\nParagraph"; var output = require( "markdown" ).markdown.toHTML( input ); print( output ); If you want more control check out the documentation in [lib/markdown.js] which details all the methods and parameters available (including examples!). One day we'll get the docs generated and hosted somewhere for nicer browsing. It also works in a browser; here is a complete example: