# Headings

mdview supports two heading formats:

* Atx-style headings. Levels 1-3 headings comprise one to three # characters followed by the heading text.
* Setext-style headings. Level 1 headings are specified by underlining the heading with a row of `=` characters, and level 2 headings are specified by underlining with a row of `-` characters.
Setext-style headings only support level 1 and level 2 headings.

-----------------------------------------

Examples:

# Heading 1

This is also heading 1
===

## Heading 2

This is also heading 2
---

### Heading 3

-----------------------------------------

## Headings and white space

Markdown specifications aren't clear about the interaction between white space
and headings, so implementations differ. For compatibility, authors should add
an empty line before and after the heading.

Without empty lines, mdview behaves as documented below. Notice that by using
hard line-breaks, you can create multi-line headings. This is a non-standard feature.

-----------------------------

```markdown
BR  

text
====
```

becomes (HTML)

```html
<p>BR<br/>
</p>
<h1>text</h1>
```

-----------------------------

```markdown
# BR

text
====
```

becomes (HTML)

```html
<h1>BR<br/>
</h1>
<h1>text</h1>
```

-----------------------------

```html
# BR  
text
====
```

becomes (HTML)

```markdown
<h1>BR<br/>
text ====</h1>
```

-----------------------------

```html
BR  
text
====
```

becomes (HTML)

```html
<h1>BR<br/>
text</h1>
```

-----------------------------

[heading and hard line-break](br_heading_test.md) (test file)

