Markdown parser in javascript