---
title: Markdown
project: Total.js V5
version: 0.0.20
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/total-js-v5/0-0-20/guides/markdown/
updated: 2026-11-16T15:32:27.494Z
---

# Markdown

> Convert Markdown to HTML with String.prototype.markdown(), and the Markdown syntax it supports.

`String.prototype.markdown([options])` converts Markdown to HTML. The output is wrapped in `<div class="markdown markdown-container">` and every block has the class `markdown-line`, so you can style it.

```js
var html = '# Hello\n\nSome **bold** text with a [link](https://www.totaljs.com).'.markdown();
```

Besides the usual headings (`#` to `#####`), `**bold**`, `*italic*`, `__bold__`, `_underline_`, `~~strike~~`, inline code, code blocks, lists (nested with tabs, tasks with `[ ]` and `[x]`), tables with alignment, `> quotes`, `---` lines, links and images, it supports a few extensions:

| Syntax | Output |
| --- | --- |
| `:check:` or `:ti ti-user:` | An icon `<i class="ti ti-check">` |
| `{keyword}(type)` | `<span class="markdown-keyword" data-type="type">` |
| `[1](#1)` and a line `#1: text` | A footnote and its text |
| `< text` | A `<section>` |
| `::: Title` … `:::` | A block that can be expanded |
| `![+alt](url)`, `![-alt](url)` | An image without `img-responsive`, a gallery image |

Headings get an `id` made from their text (turn it off with `bookmarks: false`, or add `prefix`). Each feature can be turned off: `{ tables: false, images: false, code: false }` and so on. `wrap: false` removes the outer `<div>`, `linetag` changes the `<p>` of paragraphs, and `html(text, type)` lets you change the text of each block.
