mdview supports two heading formats:
#
characters followed by space then the heading text.=
characters. Level 2 headings are specified by underlining with a row of -
characters. There are no setext-style headings for levels above 2.Examples:
Paragraph 1.
Paragraph 2.
Paragraph 3.
Bold paragraph 4.
Paragraph 5.
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.
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>
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)