Headings

mdview supports two heading formats:


Examples:

Heading 1

Paragraph 1.

This is also heading 1

Heading 2

Paragraph 2.

This is also heading 2

Heading 3

Paragraph 3.

Heading 4

Bold paragraph 4.

Heading 5

Paragraph 5.

Heading 6

Font size of heading levels 5 and 6 is smaller than the default size. Level 4 is at default font size. Levels 1 through 3 are larger than the default font size.


Headings and white space

Markdown implementations differ in the way white space interacts with headings. For maximum compatibility, authors should add an empty line before and after the heading.

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


Markdown

# BR  
text

Paragraph.

becomes (HTML)

<h1>BR<br />
text</h1>
<p>Paragraph.</p>

Markdown

BR  

text
====

becomes (HTML)

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

Markdown

# NO BR

text
====

becomes (HTML)

<p>NO BR</p>
<h1>text</h1>

Markdown

# BR  
text
====
Paragraph.

becomes (HTML)

<h1>BR<br />
text
====
Paragraph.</h1>

BR  
text
====
Paragraph.

becomes (HTML)

<h1>BR<br />
text
Paragraph.</h1>

Headings and HTML block comment

A block comment ends the heading immediately.

Markdown

# H1  
<!-- comment -->
Paragraph.

BR a  
<!-- comment -->
text a
====

BR b  
text b
<!-- comment -->
====

becomes (HTML)

<h1>H1<br />
</h1>
<p>Paragraph.</p>
<p>BR a<br />
</p>
<h1>text a</h1>
<p>BR b<br />
text b</p>
<p>====</p>

heading and hard line-break (test file)