Convertirea Markdown în HTML
Total.js adaugă markdown() șirurilor. Transformă titlurile, accentele, listele, linkurile, codul și tabelele în HTML și escapează etichetele HTML brute din text. Dă un obiect de opțiuni ca să alegi ce se convertește; cele utile sunt ul, links, formatting, headlines, code, tables și linetag (eticheta folosită pentru paragrafe).
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);
}