# Markdown naar HTML omzetten

> Gebruik het prototype String.markdown() om Markdown-tekst naar HTML te renderen, voor inhoud van gebruikers of uit bestanden.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: nl
Content-SHA256: 17a34b8aabf5522498ec6894007af404e00697deeef7446f71d2157d6ffc7c2c
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

Total.js voegt `markdown()` toe aan strings. Het zet koppen, nadruk, lijsten, links, code en tabellen om in HTML en escapet ruwe HTML-tags in de tekst. Geef een optie-object mee om te kiezen wat wordt omgezet; handig zijn `ul`, `links`, `formatting`, `headlines`, `code`, `tables` en `linetag` (de tag voor alinea's).

```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);
}
```
