# Convert Markdown to HTML

> Use the String.markdown() prototype to render Markdown text into HTML, for content stored by users or in files.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 885d1a76f84bdf5cea7d15fd5a85731160d087f50ccb2d047bac6313fcd84bf0
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

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

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