# Convertirea Markdown în HTML

> Folosește prototipul String.markdown() ca să randezi text Markdown în HTML, pentru conținut stocat de utilizatori sau în fișiere.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: ro
Content-SHA256: 2b0faf8ed461c4dd15bbc8054200f92cfefda11b5ecfacb35d7d62a5ef25e5bc
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

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).

```js controllers/content.js
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);
}
```
