Convert Markdown to HTML
Total.js adds markdown() to strings. It turns headlines, emphasis, lists, links, code and tables into HTML and escapes raw HTML tags in the text. Pass an options object to choose what is converted; the useful ones are ul, links, formatting, headlines, code, tables and linetag (the tag used for paragraphs).
exports.install = function() {
ROUTE('POST /markdown/', render);
};
function render($) {
var html = ($.body.text || '').markdown({ linetag: 'p', ul: true, links: true, formatting: true, headlines: true, code: true });
$.html(html);
}