---
title: Markdown syntax reference
nav: Syntax reference
order: 2
description: The syntax this editor's preview actually supports, on one page: headings, emphasis, lists, tables, code blocks, task lists.
updated: 2026-08-12
---

The preview is parsed by [marked.js](https://marked.js.org/) and supports GitHub Flavored Markdown (GFM).
Everything below can be pasted straight into the editor.

## Headings

```
# Heading 1
## Heading 2
### Heading 3
```

Headings get anchor ids automatically, so headings in the preview can be linked to.

## Emphasis

```
**bold** *italic* ~~strikethrough~~ `inline code`
<u>underline</u>
```

Markdown has no underline syntax — the toolbar's Underline button inserts the HTML `<u>` tag.
Other Markdown tools may not support it, so be careful if this document will later be fed to a different generator.

## Lists

```
- item
- item
  - nested item (indent by two spaces)

1. ordered item
2. ordered item

- [x] a finished task
- [ ] an unfinished task
```

## Links and images

```
[link text](https://example.com)
![alt text](images/screenshot.png)
```

Image paths are relative to **the folder the document lives in**. Because the preview runs in the browser,
a local image only shows up if the browser can reach that path; a full URL, or keeping images in the same
folder, is the safer bet.

## Blockquotes and dividers

```
> A blockquote can span several lines,
> as long as every line starts with the marker.

---
```

## Tables

```
| Column | Description | Count |
| --- | :---: | ---: |
| left | center | right |
| a | b | 3 |
```

Colons in the separator row set the alignment: `:---` left, `:---:` center, `---:` right.
The toolbar's Table button asks how many columns you want, then inserts the header and separator rows.

## Code blocks

Put a line of three backticks before and after the code; the opening line may name the language:

~~~
```js
const answer = 42;
```
~~~

Each code block in the preview gets a **Copy** button in its top-right corner — one click takes the whole block.

## Line breaks

A single newline in Markdown is **not** a line break. There are two ways to get one:

```
end the line with two spaces  
and the next line breaks

Or leave a blank line
to get two separate paragraphs.
```

## The one thing this editor adds

YAML front matter at the top of a file is not swallowed as a divider or a heading — it is rendered as its
own card. Details in [YAML front matter](/en/MDEditor/docs/front-matter).
