Markdown version 1.1.15
[markdown.git] / syntax.md
blob285629365078d7fe7fa664c83fc1546f3bd66a27
1 ================
2 Markdown: Syntax
3 ================
5 * [Markdown Basics]
6 * _[Syntax]( "Markdown Syntax Documentation")_
7 * [License]
9 - - - - -
11 *   [Overview]
12     *   [Philosophy]
13     *   [Inline HTML]
14     *   [Automatic Escaping for Special Characters]
15 *   [Block Elements]
16     *   [Paragraphs and Line Breaks]
17     *   [Headers]
18     *   [Blockquotes]
19     *   [Lists]
20     *   [Tables]
21     *   [Style Sheet]
22     *   [Code Blocks]
23     *   [Horizontal Rules]
24 *   [Span Elements]
25     *   [Links]
26     *   [Emphasis]
27     *   [Code]
28     *   [Images]
29 *   [Miscellaneous]
30     *   [Automatic Links]
31     *   [Backslash Escapes]
32     *   [XML Comments]
33     *   [YAML Front Matter]
36 **Note:** This document is itself written using Markdown; you
37 can [see the source for it by adding `.md` to the URL][src].
39   [markdown basics]: basics.html  "Markdown Basics"
40   [license]: license.html "License Information"
41   [src]: syntax.md
43 - - - - -
45 --------
46 Overview
47 --------
49 ~~~~~~~~~~
50 Philosophy
51 ~~~~~~~~~~
53 Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
55 Readability, however, is emphasized above all else. A Markdown-formatted
56 document should be publishable as-is, as plain text, without looking
57 like it's been marked up with tags or formatting instructions. While
58 Markdown's syntax has been influenced by several existing text-to-HTML
59 filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4],
60 [Grutatext] [5], and [EtText] [6] -- the single biggest source of
61 inspiration for Markdown's syntax is the format of plain text email.
63   [1]: https://docutils.sourceforge.io/mirror/setext.html
64   [2]: http://www.aaronsw.com/2002/atx/
65   [3]: https://www.booked.net/textism.html
66   [4]: https://docutils.sourceforge.io/rst.html
67   [5]: https://triptico.com/software/grutatxt.html
68   [6]: http://ettext.taint.org/doc/
70 To this end, Markdown's syntax is comprised entirely of punctuation
71 characters, which punctuation characters have been carefully chosen so
72 as to look like what they mean. E.g., asterisks around a word actually
73 look like \*emphasis\*. Markdown lists look like, well, lists. Even
74 blockquotes look like quoted passages of text, assuming you've ever
75 used email.
78 ~~~~~~~~~~~
79 Inline HTML
80 ~~~~~~~~~~~
82 Markdown's syntax is intended for one purpose: to be used as a
83 format for *writing* for the web.
85 Markdown is not a replacement for HTML, or even close to it. Its
86 syntax is very small, corresponding only to a very small subset of
87 HTML tags. The idea is *not* to create a syntax that makes it easier
88 to insert HTML tags. In my opinion, HTML tags are already easy to
89 insert. The idea for Markdown is to make it easy to read, write, and
90 edit prose. HTML is a *publishing* format; Markdown is a *writing*
91 format. Thus, Markdown's formatting syntax only addresses issues that
92 can be conveyed in plain text.
94 For any markup that is not covered by Markdown's syntax, you simply
95 use HTML itself. There's no need to preface it or delimit it to
96 indicate that you're switching from Markdown to HTML; you just use
97 the tags.
99 The only restrictions are that block-level HTML elements -- e.g. `<div>`,
100 `<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding
101 content by blank lines, and the start and end tags of the block should
102 not be indented with tabs or spaces. Markdown is smart enough not
103 to add extra (unwanted) `<p>` tags around HTML block-level tags.
105 For example, to add an HTML table to a Markdown article:
107       This is a regular paragraph.
109       <table>
110           <tr>
111               <td>Foo</td>
112           </tr>
113       </table>
115       This is another regular paragraph.
117 Note that Markdown formatting syntax is not processed within block-level
118 HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an
119 HTML block.
121 Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be
122 used anywhere in a Markdown paragraph, list item, or header. If you
123 want, you can even use HTML tags instead of Markdown formatting; e.g. if
124 you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's
125 link or image syntax, go right ahead.
127 Unlike block-level HTML tags, Markdown syntax *is* processed within
128 span-level tags.
130 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131 Automatic Escaping for Special Characters
132 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134 In HTML, there are two characters that demand special treatment: `<`
135 and `&`. Left angle brackets are used to start tags; ampersands are
136 used to denote HTML entities. If you want to use them as literal
137 characters, you must escape them as entities, e.g. `&lt;`, and
138 `&amp;`.
140 Ampersands in particular are bedeviling for web writers. If you want to
141 write about 'AT&T', you need to write '`AT&amp;T`'. You even need to
142 escape ampersands within URLs. Thus, if you want to link to:
144       https://images.google.com/images?num=30&q=larry+bird
146 you need to encode the URL as:
148       https://images.google.com/images?num=30&amp;q=larry+bird
150 in your anchor tag `href` attribute. Needless to say, this is easy to
151 forget, and is probably the single most common source of HTML validation
152 errors in otherwise well-marked-up web sites.
154 Markdown allows you to use these characters naturally, taking care of
155 all the necessary escaping for you. If you use an ampersand as part of
156 an HTML entity, it remains unchanged; otherwise it will be translated
157 into `&amp;`.
159 So, if you want to include a copyright symbol in your article, you can write:
161       &copy;
163 and Markdown will leave it alone. But if you write:
165       AT&T
167 Markdown will translate it to:
169       AT&amp;T
171 Similarly, because Markdown supports [inline HTML](#html), if you use
172 angle brackets as delimiters for HTML tags, Markdown will treat them as
173 such. But if you write:
175       4 < 5
177 Markdown will translate it to:
179       4 &lt; 5
181 However, inside Markdown code spans and blocks, angle brackets and
182 ampersands are *always* encoded automatically. This makes it easy to use
183 Markdown to write about HTML code. (As opposed to raw HTML, which is a
184 terrible format for writing about HTML syntax, because every single `<`
185 and `&` in your example code needs to be escaped.)
188 - - - - -
190 --------------
191 Block Elements
192 --------------
194 ~~~~~~~~~~~~~~~~~~~~~~~~~~
195 Paragraphs and Line Breaks
196 ~~~~~~~~~~~~~~~~~~~~~~~~~~
198 A paragraph is simply one or more consecutive lines of text, separated
199 by one or more blank lines.  (A blank line is any line that looks like a
200 blank line -- a line containing nothing but spaces or tabs is considered
201 blank.)  Normal paragraphs should not be indented with spaces or tabs.
202 Note that Markdown expands all tabs to spaces before doing anything else.
204 The implication of the "one or more consecutive lines of text" rule is
205 that Markdown supports "hard-wrapped" text paragraphs. This differs
206 significantly from most other text-to-HTML formatters (including Movable
207 Type's "Convert Line Breaks" option) which translate every line break
208 character in a paragraph into a `<br />` tag.
210 When you *do* want to insert a `<br />` break tag using Markdown, you
211 end a line with two or more spaces, then type return.
213 Alternatively, a line ending with a backslash `\` that's at the very end
214 of the line (that's not inside a table or code block) will also translate
215 into a `<br />` tag (the `\` is replaced).  To keep a literal `\` at the
216 end of a line (that's not inside a table or code block), double it.
218 If you end a line with three or more spaces then a `<br clear="all" />`
219 tag will be generated instead of the plain `<br />` tag.
221 Yes, this takes a tad more effort to create a `<br />`, but a simplistic
222 "every line break is a `<br />`" rule wouldn't work for Markdown.
223 Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l]
224 work best -- and look better -- when you format them with hard breaks.
226   [bq]: #blockquote
227   [l]:  #list
230 ~~~~~~~
231 Headers
232 ~~~~~~~
234 Markdown supports two styles of headers, [Setext] [1] and [atx] [2].
236 Setext-style headers are "underlined" using equal signs (for first-level
237 headers), dashes (for second-level headers) and tildes (for third-level
238 headers). For example:
240       This is an H1
241       =============
243       This is an H2
244       -------------
246       This is an H3
247       ~~~~~~~~~~~~~
249 Any number of underlining `=`'s will work.  Any number of underlining
250 `-`'s will work but be careful it's not mistaken for a horizontal rule.
251 For `~`'s, try to use at least four to avoid being mistaken for
252 strike through text or a `~~~`-delimited code block.
254 An optional matching "overline" may precede the header like so:
256       =============
257       This is an H1
258       =============
260       -------------
261       This is an H2
262       -------------
264       ~~~~~~~~~~~~~
265       This is an H3
266       ~~~~~~~~~~~~~
268 Atx-style headers use 1-6 hash characters at the start of the line,
269 corresponding to header levels 1-6. For example:
271       # This is an H1
273       ## This is an H2
275       ###### This is an H6
277 Optionally, you may "close" atx-style headers. This is purely
278 cosmetic -- you can use this if you think it looks better. The
279 closing hashes don't even need to match the number of hashes
280 used to open the header. (The number of opening hashes
281 determines the header level.) :
283       # This is an H1 #
285       ## This is an H2 ##
287       ### This is an H3 ######
290 ~~~~~~~~~~~
291 Blockquotes
292 ~~~~~~~~~~~
294 Markdown uses email-style `>` characters for blockquoting. If you're
295 familiar with quoting passages of text in an email message, then you
296 know how to create a blockquote in Markdown. It looks best if you hard
297 wrap the text and put a `>` before every line:
299       > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
300       > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
301       > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
302       >
303       > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
304       > id sem consectetuer libero luctus adipiscing.
306 Markdown allows you to be lazy and only put the `>` before the first
307 line of a hard-wrapped paragraph:
309       > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
310       consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
311       Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
313       > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
314       id sem consectetuer libero luctus adipiscing.
316 Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
317 adding additional levels of `>`:
319       > This is the first level of quoting.
320       >
321       > > This is nested blockquote.
322       >
323       > Back to the first level.
325 Blockquotes can contain other Markdown elements, including headers, lists,
326 and code blocks:
328       > ## This is a header.
329       >
330       > 1.  This is the first list item.
331       > 2.  This is the second list item.
332       >
333       > Here's some example code:
334       >
335       >     return shell_exec("echo $input | $markdown_script");
337 Any decent text editor should make email-style quoting easy. For
338 example, with BBEdit, you can make a selection and choose Increase
339 Quote Level from the Text menu.
342 ~~~~~
343 Lists
344 ~~~~~
346 Markdown supports ordered (numbered, lettered or roman numeraled)
347 and unordered (bulleted) lists.
349 Unordered lists use asterisks, pluses, and hyphens -- interchangably
350 -- as list markers:
352       *   Red
353       *   Green
354       *   Blue
356 is equivalent to:
358       +   Red
359       +   Green
360       +   Blue
362 and:
364       -   Red
365       -   Green
366       -   Blue
368 Ordered lists use numbers or letters (latin or greek) or roman numerals
369 followed by a period or right parenthesis `)`:
371       1.  Bird
372       2.  McHale
373       3.  Parish
375 It's important to note that the actual numbers (or letters or roman
376 numerals) you use to mark the list *do* have an effect on the HTML
377 output Markdown produces, but only if you skip ahead and/or change
378 the list marker style.
380 The HTML Markdown produces from the above list is:
382       <ol>
383       <li>Bird</li>
384       <li>McHale</li>
385       <li>Parish</li>
386       </ol>
388 If you instead wrote the list in Markdown like this:
390       1.  Bird
391       1.  McHale
392       1.  Parish
394 or even:
396       3. Bird
397       1. McHale
398       8. Parish
400 you'd get the exact same HTML output in the first case, but in the
401 second case the numbers would be in the sequence 3, 4 and 8 because
402 you are only allowed to skip ahead (and the first item in the list
403 must be numbered at least 0 [or `a`, `i`, etc.]).
405 The point is, if you want to, you can use ordinal numbers in your
406 ordered Markdown lists, so that the numbers in your source match the
407 numbers in your published HTML.  But if you want to be lazy, you don't
408 have to.
410 The style of the list marker is determined by the first list item.
411 If the first list item uses numbers the list style will be `decimal`.
412 If the first list item uses a roman numeral then the list style will
413 be either `lower-roman` or `upper-roman` depending on the case used.
414 Similarly for any non-roman letter you get `lower-alpha`, `upper-alpha`
415 or `lower-greek`.
417 However, if later list items change the style, an attempt is made to
418 modify the list numbering style for that item which should be effective
419 in just about any browser available today.
421 Similarly if a list item "skips ahead" an attempt is made to skip the
422 list number ahead which again should be effective in just about any
423 browser available today.
425 A right parenthesis ')' may be used in place of the `.` for any of the
426 numbering styles but it requires the [style sheet] to be included or
427 you will end up just seeing `.` instead.  For example this list:
429       a)  Alpha
430       b)  Beta
431       c)  Gamma
433 will end up being displayed like this without the [style sheet]:
435       a.  Alpha
436       b.  Beta
437       c.  Gamma
439 If you do use lazy list numbering, however, you should still start the
440 list with the number 1 (or letter A or a or roman numeral I or i) or even
441 a higher number if desired and then stick with that number (or letter) for
442 the rest of the items.  Since you may only skip forward in the numbering,
443 the items will end up numbered (or "lettered") starting with the value
444 used for the first item.
446 List markers typically start at the left margin, but may be indented by
447 up to three spaces.  List markers must be followed by one or more spaces.
449 Attempts to change an unordered list's style or switch from an ordered
450 list to an unordered list (or vice versa) in mid-list are ignored.
452 Lists end when the first non-blank, non-indented line (relative to the
453 current list nesting level) is encountered that does not begin with a
454 list marker.
456 To create two distinct lists when there are only blank lines between the
457 end of the first list and the start of the second, a separator line must
458 be inserted.  ([Horizontal rules] work just fine for this).
460 If desired, an [XML-style comment][X] (e.g. `<!-- -->`) may be used for this
461 purpose provided it is preceded and followed by at least one blank line.
463 Any non-list-marker, non-blank, non-indented (relative to the current
464 list nesting level) line may be used for this purpose but the [XML-style
465 comment][X] has the advantage of not causing anything extra to be shown
466 when the HTML output is displayed in a browser.
468 To make lists look nice, you can wrap items with hanging indents:
470       *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
471           Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
472           viverra nec, fringilla in, laoreet vitae, risus.
473       *   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
474           Suspendisse id sem consectetuer libero luctus adipiscing.
476 But if you want to be lazy, you don't have to:
478       *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
479       Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
480       viverra nec, fringilla in, laoreet vitae, risus.
481       *   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
482       Suspendisse id sem consectetuer libero luctus adipiscing.
484 If list items are separated by blank lines, Markdown will wrap the
485 items in `<p>` tags in the HTML output. For example, this input:
487       *   Bird
488       *   Magic
490 will turn into:
492       <ul>
493       <li>Bird</li>
494       <li>Magic</li>
495       </ul>
497 But this:
499       *   Bird
501       *   Magic
503 will turn into:
505       <ul>
506       <li><p>Bird</p></li>
507       <li><p>Magic</p></li>
508       </ul>
510 List items may consist of multiple paragraphs. Each subsequent
511 paragraph in a list item must be indented by 4 spaces:
513       1.  This is a list item with two paragraphs. Lorem ipsum dolor
514           sit amet, consectetuer adipiscing elit. Aliquam hendrerit
515           mi posuere lectus.
517           Vestibulum enim wisi, viverra nec, fringilla in, laoreet
518           vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
519           sit amet velit.
521       2.  Suspendisse id sem consectetuer libero luctus adipiscing.
523 It looks nice if you indent every line of the subsequent
524 paragraphs, but here again, Markdown will allow you to be
525 lazy:
527       *   This is a list item with two paragraphs.
529           This is the second paragraph in the list item. You're
530       only required to indent the first line. Lorem ipsum dolor
531       sit amet, consectetuer adipiscing elit.
533       *   Another item in the same list.
535 To put a blockquote within a list item, the blockquote's `>`
536 delimiters need to be indented:
538       *   A list item with a blockquote:
540           > This is a blockquote
541           > inside a list item.
543 To put a code block within a list item, the code block needs
544 to be indented *twice* (in other words 8 spaces):
546       *   A list item with a code block:
548               <code goes here>
551 It's worth noting that it's possible to trigger an ordered list by
552 accident, by writing something like this:
554       1986. What a great season.
556 In other words, a *number-period-space* sequence at the beginning of a
557 line. To avoid this, you can backslash-escape the period:
559       1986\. What a great season.
561 Markdown tries to be smart about this and requires either a blank line
562 before something that looks like a list item or requires that a list
563 definition is already active or requires that two lines in a row look
564 like list items in order for Markdown to recognize a list item.
566 So the above, by itself without the escaped ".", will not start a list
567 when it's outside of any list unless it's preceded by a blank line or
568 immediately followed by another line that looks like a list item (either
569 of the same kind or of a sublist).
571 [X]: #XML_Comments "XML Comments"
574 ~~~~~~
575 Tables
576 ~~~~~~
578 Markdown supports simple tables like so:
580     | Item | Price | Description |
581     | ---- | -----:| ----------- |
582     | Nut  | $1.29 | Delicious   |
583     | Bean | $0.37 | Fiber       |
585 Output:
587     <table>
588       <tr><th>Item</th><th align="right">Price</th><th>Description</th></tr>
589       <tr><td>Nut</td><td align="right">$1.29</td><td>Delicious</td></tr>
590       <tr><td>Bean</td><td align="right">$0.37</td><td>Fiber</td></tr>
591     </table>
593 The leading `|` on each line is optional unless the first column contains only
594 zero or more spaces and/or tabs.  The trailing `|` on each line is optional
595 unless the last column contains only zero or more spaces and/or tabs.
597 At least one `|` must be present in every row of the table.
599 Leading and trailing whitespace are always trimmed from each column's value
600 before using it.
602 To include a literal `|` (vertical bar) character in a column's value, precede
603 it with a `\` (backslash).  To include a literal `\` use `\\` (double them).
605 The number of columns in the separator row must match exactly the number of
606 columns in the header row in order for the table to be recognized.
608 Each separator in the separator line must be one or more `-` (dash) characters
609 optionally with a `:` (colon) on either or both ends.  With no colons the
610 column alignment will be the default.  With a colon only on the left the
611 alignment will be `left`.  With a colon only on the right the alignment will
612 be `right`.  And finally, with a colon on both ends the alignment will be
613 `center`.  The alignment will be applied to the column in both header and body
614 rows.
616 If all columns in the header row are empty (i.e. contain only zero or more
617 spaces and/or tabs), the header row will be omitted from the output.  Empty
618 rows in the body of the table are always preserved in the output.
620 Body rows that contain fewer columns than the header row have empty columns
621 added.  Body rows that contain more columns than the header row have the
622 extra columns dropped.
624 The vertical bars do not need to be lined up, sloppy tables work just fine.
625 The above example could be rewritten like so:
627     Item|Price|Description
628     -|-:|-
629     Nut|$1.29|Delicious
630     Bean|$0.37|Fiber
632 Inline markup is recognized just fine within each column:
634     |Example
635     |:-
636     |~~Strikeout~~ `code` _etc._
638 Row text can be split over multiple rows by ending a row with a
639 backslash (`\`) as the last character on the line.
641 For example, this:
643     Item|Price|Description
644     -|-:|-
645     Nut|$1.29|Delicious
646     Bean|$0.37|Fiber
647     Squash|$1.83|Healthy
649 Generates output something like this:
651     <table>
652       <tr><th>Item</th><th>Price</th><th>Description</th></tr>
653       <tr><td>Nut</td><td>$1.29</td><td>Delicious</td></tr>
654       <tr><td>Bean</td><td>$0.37</td><td>Fiber</td></tr>
655       <tr><td>Squash</td><td>$1.83</td><td>Healthy</td></tr>
656     </table>
658 But adding a trailing `\` to the end of first table body row like
661     Item|Price|Description
662     -|-:|-
663     Nut|$1.29|Delicious \
664     Bean|$0.37|Fiber
665     Squash|$1.83|Healthy
667 Generates this output instead:
669     <table>
670       <tr><th>Item</th><th>Price</th><th>Description</th></tr>
671       <tr><td>Nut Bean</td><td>$1.29 $0.37</td><td>Delicious Fiber</td></tr>
672       <tr><td>Squash</td><td>$1.83</td><td>Healthy</td></tr>
673     </table>
675 The corresponding columns of the first two rows are merged.  It's
676 possible to merge multiple rows.  Adding a trailing `\` to the
677 second row too would result in a single row output table.
679 The `\` must be the very last character on the line to be recognized
680 as a "row-joiner".  If the optional trailing `|` has been included
681 the "row-joiner" must appear after that like so:
683     Item|Price|Description|
684     -|-:|-|
685     Nut|$1.29|Delicious| \
686     Bean|$0.37|Fiber|
687     Squash|$1.83|Healthy|
689 The advantage of including the optional trailing `|` when using a
690 "row-joiner" is that renderers that do not support the "row-joiner"
691 will see that as a superfluous extra column instead and discard it.
694 ~~~~~~~~~~~
695 Style Sheet
696 ~~~~~~~~~~~
698 If an unordered list item begins with `[ ]` or `[x]` then its bullet will
699 be suppressed and a nice checkbox shown instead.  In order for the fancy
700 checkboxes to show the markdown style sheet must be included.
702 It may be included in the output with the `--show-stylesheet` option.
703 To get just the style sheet, run `Markdown.pl` with no arguments with the
704 input redirected to `/dev/null`.  Without the style sheet these items
705 will show normally (i.e. with a bullet and as `[ ]` or `[x]`).
707 Ordered lists that make use of a `)` instead of a `.` to terminate the
708 marker also require the style sheet otherwise they will display with
709 the normal `.` marker termination.
712 ~~~~~~~~~~~
713 Code Blocks
714 ~~~~~~~~~~~
716 Pre-formatted code blocks are used for writing about programming or
717 markup source code. Rather than forming normal paragraphs, the lines
718 of a code block are interpreted literally. Markdown wraps a code block
719 in both `<pre>` and `<code>` tags.
721 To produce a code block in Markdown, simply indent every line of the
722 block by at least 4 spaces.  Alternatively precede the block with a
723 line consisting of 3 backtick quotes (or more) and follow it with a
724 line consisting of the same number of backtick quotes -- in this case the
725 code lines themselves do not require any additional indentation.
726 For example, given this input:
728       This is a normal paragraph:
730           This is a code block.
732 Or this equivalent input:
734       This is a normal paragraph.
736       ```
737       This is a code block.
738       ```
740 Markdown will generate:
742       <p>This is a normal paragraph:</p>
744       <pre><code>This is a code block.
745       </code></pre>
747 Note that when using the 3 backtick quotes technique, the blank line
748 before the start of the code block is optional. One level of
749 indentation -- 4 spaces -- is removed from each line of the code block
750 unless the 3 backtick quotes are used.  For example, this:
752       Here is an example of AppleScript:
754           tell application "Foo"
755               beep
756           end tell
758 will turn into:
760       <p>Here is an example of AppleScript:</p>
762       <pre><code>tell application "Foo"
763           beep
764       end tell
765       </code></pre>
767 A code block continues until it reaches a line that is not indented
768 (or the end of the article) when using the indentation technique or
769 until a line consisting of the same number of backtick quotes is found
770 when using the 3 backtick quotes technique.
772 Also note that within a backticks-delimited code block, tab characters
773 are always expanded with the tab stop locations 8 characters apart.
775 As an alternative to using backticks, limited recognition is available
776 for tilde-delimited code blocks.  Instead of backtick quotes, exactly 3
777 tildes (`~~~`) may be used to introduce the code block in which case
778 it must also be closed by tildes instead of backtick quotes.
780 Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
781 are automatically converted into HTML entities. This makes it very
782 easy to include example HTML source code using Markdown -- just paste
783 it and indent it, and Markdown will handle the hassle of encoding the
784 ampersands and angle brackets. For example, this:
786       <div class="footer">
787           &copy; 2004 Foo Corporation
788       </div>
790 will turn into:
792       <pre><code>&lt;div class="footer"&gt;
793           &amp;copy; 2004 Foo Corporation
794       &lt;/div&gt;
795       </code></pre>
797 Regular Markdown syntax is not processed within code blocks. E.g.,
798 asterisks are just literal asterisks within a code block. This means
799 it's also easy to use Markdown to write about Markdown's own syntax.
802 ~~~~~~~~~~~~~~~~
803 Horizontal Rules
804 ~~~~~~~~~~~~~~~~
806 You can produce a horizontal rule tag (`<hr />`) by placing three or
807 more hyphens, asterisks, or underscores on a line by themselves. If you
808 wish, you may use spaces between the hyphens or asterisks. Each of the
809 following lines will produce a horizontal rule:
811       * * *
813       ***
815       *****
817       - - -
819       ---------------------------------------
821 Note that when using a line of three or more solid hyphens, if the
822 preceding line is not empty, then it will be treated as part of one of
823 the H2 Setext-style [headers].  Add at least one space between the
824 hyphens to prevent that (or use asterisks or make sure the preceding
825 line is blank).
828 - - - - -
831 -------------
832 Span Elements
833 -------------
835 ~~~~~
836 Links
837 ~~~~~
839 Markdown supports two style of links: *inline* and *reference* by default.
841 In both styles, the link text is delimited by [square brackets].
843 Additionally, if enabled, [Wiki Style Links] are also supported, but
844 they are delimited by doubled square brackets (e.g. `[[wiki link]]`)
845 and have different semantics -- see the end of this section for that.
847 To create an inline link, use a set of regular parentheses immediately
848 after the link text's closing square bracket. Inside the parentheses,
849 put the URL where you want the link to point, along with an *optional*
850 title for the link, surrounded in quotes. For example:
852       This is [an example](http://example.com/ "Title") inline link.
854       [This link](http://example.net/) has no title attribute.
856 Will produce:
858       <p>This is <a href="http://example.com/" title="Title">
859       an example</a> inline link.</p>
861       <p><a href="http://example.net/">This link</a> has no
862       title attribute.</p>
864 If you're referring to a local resource on the same server, you can
865 use relative paths:
867       See my [About](/about/) page for details.
869 Reference-style links use a second set of square brackets, inside
870 which you place a label of your choosing to identify the link:
872       This is [an example][id] reference-style link.
874 You can optionally use a space to separate the sets of brackets:
876       This is [an example] [id] reference-style link.
878 Then, anywhere in the document, you define your link label like this,
879 on a line by itself:
881       [id]: http://example.com/  "Optional Title Here"
883 That is:
885 *   Square brackets containing the link identifier (optionally
886     indented from the left margin using up to three spaces);
887 *   followed by a colon;
888 *   followed by one or more spaces (or tabs);
889 *   followed by the URL for the link;
890 *   optionally followed by a title attribute for the link, enclosed
891     in double or single quotes, or enclosed in parentheses.
893 The following three link definitions are equivalent:
895       [foo]: http://example.com/  "Optional Title Here"
896       [foo]: http://example.com/  'Optional Title Here'
897       [foo]: http://example.com/  (Optional Title Here)
899 **Note:** There is a known bug in Markdown.pl 1.0.3 which prevents
900 single quotes from being used to delimit link titles.
902 The link URL may, optionally, be surrounded by angle brackets:
904       [id]: <http://example.com/>  "Optional Title Here"
906 You can put the title attribute on the next line and use extra spaces
907 or tabs for padding, which tends to look better with longer URLs:
909       [id]: http://example.com/longish/path/to/resource/here
910             "Optional Title Here"
912 You can put the URL on the next line and use extra spaces
913 or tabs for padding, which tends to look better with longer ids:
915       [a really really long link identifier]:
916             http://example.com/ "Optional Title Here"
918 You can put both the title attribute and the URL on separate lines
919 and use extra spaces or tabs for padding:
921       [a really really long link identifier]:
922             http://example.com/longish/path/to/resource/here
923             "Optional Title Here"
925 Link definitions are only used for creating links during Markdown
926 processing, and are stripped from your document in the HTML output.
928 Link definition names may consist of letters, numbers, spaces, and
929 punctuation -- but they are *not* case sensitive. E.g. these two
930 links:
932       [link text][a]
933       [link text][A]
935 are equivalent.
937 The *implicit link name* shortcut allows you to omit the name of the
938 link, in which case the link text itself is used as the name.
939 Just use an empty set of square brackets (or none) -- e.g., to link the
940 word "Google" to the google.com web site, you could simply write:
942       [Google][]
944 Or even just this:
946       [Google]
948 And then define the link:
950       [Google]: https://google.com/
952 Because link names may contain spaces, this shortcut even works for
953 multiple words in the link text:
955       Visit [Daring Fireball] for more information.
957 And then define the link:
959       [Daring Fireball]: https://daringfireball.net/
961 Text inside square brackets is left completely unchanged (including the
962 surrounding brackets) _unless_ it matches a link definition.  Furthermore,
963 the single pair of surrounding square brackets case is always checked
964 for last so you may only omit the trailing `[]` of an *implicit link name*
965 shortcut when the result would still be unambiguous.
967 Link definitions can be placed anywhere in your Markdown document. I
968 tend to put them immediately after each paragraph in which they're
969 used, but if you want, you can put them all at the end of your
970 document, sort of like footnotes.
972 All first, second and third level headers defined at the top-level
973 (in other words they are not in lists and start at the left margin)
974 using either the setext-style or atx-style automatically have an
975 anchor id and link definition added for them provided there is not
976 already a previous definition with the same id.  You can use this
977 to place a table-of-contents at the top of the document that links
978 to subsections later in the document.  Just like this document.
980 For example, all six of these links point to subsections later in
981 the same document:
983       * Self Same
984         * [Introduction]
985         * [Part Two]
986         * [Part Three]
987       * Different
988         * [Introduction](#Part-Two)
989         * [Part Two](#Part_Three)
990         * [Part Three](#introduction)
992       ## Introduction
994       ## Part Two
996       ## Part Three
998 Here's an example of reference links in action:
1000       I get 10 times more traffic from [Google] [1] than from
1001       [Yahoo] [2] or [MSN] [3].
1003       [1]: https://google.com/       "Google"
1004       [2]: https://search.yahoo.com/ "Yahoo Search"
1005       [3]: https://search.msn.com/   "MSN Search"
1007 Using the implicit link name shortcut, you could instead write:
1009       I get 10 times more traffic from [Google] than from
1010       [Yahoo] or [MSN].
1012       [google]: https://google.com/       "Google"
1013       [yahoo]:  https://search.yahoo.com/ "Yahoo Search"
1014       [msn]:    https://search.msn.com/   "MSN Search"
1016 Both of the above examples will produce the following HTML output:
1018       <p>I get 10 times more traffic from <a href="https://google.com/"
1019       title="Google">Google</a> than from
1020       <a href="https://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
1021       or <a href="https://search.msn.com/" title="MSN Search">MSN</a>.</p>
1023 For comparison, here is the same paragraph written using
1024 Markdown's inline link style:
1026       I get 10 times more traffic from [Google](https://google.com/ "Google")
1027       than from [Yahoo](https://search.yahoo.com/ "Yahoo Search") or
1028       [MSN](https://search.msn.com/ "MSN Search").
1030 The point of reference-style links is not that they're easier to
1031 write. The point is that with reference-style links, your document
1032 source is vastly more readable. Compare the above examples: using
1033 reference-style links, the paragraph itself is only 81 characters
1034 long; with inline-style links, it's 176 characters; and as raw HTML,
1035 it's 234 characters. In the raw HTML, there's more markup than there
1036 is text.
1038 With Markdown's reference-style links, a source document much more
1039 closely resembles the final output, as rendered in a browser. By
1040 allowing you to move the markup-related metadata out of the paragraph,
1041 you can add links without interrupting the narrative flow of your
1042 prose.
1044 #### Wiki Style Links
1046 To create a wiki style link, simply use double brackets instead of
1047 single brackets like so:
1049       [[wiki link]]
1050       [[wiki link|alternate_destination]]
1052 Even when not explicitly enabled, a few, limited, wiki style links
1053 are always recognized:
1055       [[http://example.com]]
1056       [[link here|http://example.com]]
1057       [[link here|#destination]]
1059 The "http:" part can also be "https:", "ftp:" and "ftps:".  The
1060 three above links generate these "a" tags:
1062       <a href="http://example.com">http://example.com</a>
1063       <a href="http://example.com">link here</a>
1064       <a href="#destination">link here</a>
1066 If full wiki style links have been enabled (via the `--wiki` option),
1067 then additional links like these will work too:
1069       [[another page]]
1070       [[link here|another page]]
1071       [[elsewhere#section]]
1072       [[link here|elsewhere#section]]
1074 They will all generate "a" tags and are intended to link to another
1075 document.  Exactly what link is generated depends on the value
1076 passed to the `--wiki` option.  Using the default value, those four
1077 links above would generate these "a" tags:
1079       <a href="another_page.html">another page</a>
1080       <a href="another_page.html">link here</a>
1081       <a href="elsewhere.html#section">elsewhere#section</a>
1082       <a href="elsewhere.html#section">link here</a>
1084 If full wiki style links have been enabled (via the `--wiki` option),
1085 image links may be created using the wiki syntax like so:
1087       [[some-image.png]]
1088       [[other-image.jpg|alt=text for alt]]
1089       [[image-left.svg|align=left]]
1090       [[image-on-right.jpeg|align=right]]
1091       [[in-a-div.gif|align=center]]
1092       [[image-right.svg|align=left,alt=text for image]]
1093       [[scaled.svg|width=200,height=100,alt=scaled image]]
1095 For a wiki style image link to be recognized, the "link" part (which
1096 is just the part to the left of the `|` if it's present), must:
1098   * not have any embedded spaces (leading/trailing will be stripped)
1099   * must end in a well-known image suffix (case insensitively)
1101 Currently only `.png`, `.gif`, `.jpg`, `.jpeg`, `.svg` and `.svgz`
1102 are recognized as "well-known image suffixes".
1104 If the optional "|..." part is present for a wiki image link, then
1105 the "alt=" part must be at the end as it will consume all the
1106 remaining text.  Currently only the "align=", "width=", "height="
1107 and "alt=" keywords are recognized.  Keywords are comma (",")
1108 separated (with optional surrounding whitespace).  Note that width
1109 and height are in pixels.
1111 Using either "left" or "right" for the "align=" keyword causes the
1112 image to be floated either left or right respectively.  Using
1113 "center" for the "align=" keyword causes the image to be placed in
1114 its own "div" with a "center" alignment.
1116 See the command line help (`Markdown.pl --help`) for more details
1117 on exactly how the wiki style links are transformed into "a"/"img"
1118 tags.
1121 ~~~~~~~~
1122 Emphasis
1123 ~~~~~~~~
1125 Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
1126 emphasis. Text wrapped with one `*` or `_` will be wrapped with an
1127 HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
1128 `<strong>` tag. Double `~`'s will be wrapped with an HTML `<strike>` tag.
1129 E.g., this input:
1131       *single asterisks*
1133       _single underscores_
1135       **double asterisks**
1137       __double underscores__
1139       ~~double tildes~~
1141 will produce:
1143       <em>single asterisks</em>
1145       <em>single underscores</em>
1147       <strong>double asterisks</strong>
1149       <strong>double underscores</strong>
1151       <strike>strike through</strike>
1153 You can use whichever style you prefer; the lone restriction is that
1154 the same character must be used to open and close an emphasis span.
1155 Additionally `_` and double `_` are not recognized within words.
1157 Emphasis using `*`'s or `~`'s can be used in the middle of a word:
1159       un*frigging*believable fan~~frigging~~tastic
1161 But if you surround an `*`, `_` or `~` with spaces, it'll be treated as a
1162 literal asterisk, underscore or tilde.
1164 To produce a literal asterisk, underscore or tilde at a position where it
1165 would otherwise be used as an emphasis delimiter, you can backslash
1166 escape it:
1168       \*this text is surrounded by literal asterisks\*
1171 ~~~~
1172 Code
1173 ~~~~
1175 To indicate a span of code, wrap it with backtick quotes (`` ` ``).
1176 Unlike a pre-formatted code block, a code span indicates code within a
1177 normal paragraph. For example:
1179       Use the `printf()` function.
1181 will produce:
1183       <p>Use the <code>printf()</code> function.</p>
1185 To include a literal backtick character within a code span, you can use
1186 multiple backticks as the opening and closing delimiters:
1188       ``There is a literal backtick (`) here.``
1190 which will produce this:
1192       <p><code>There is a literal backtick (`) here.</code></p>
1194 The backtick delimiters surrounding a code span may include spaces --
1195 one after the opening, one before the closing. This allows you to place
1196 literal backtick characters at the beginning or end of a code span:
1198       A single backtick in a code span: `` ` ``
1200       A backtick-delimited string in a code span: `` `foo` ``
1202 will produce:
1204       <p>A single backtick in a code span: <code>`</code></p>
1206       <p>A backtick-delimited string in a code span: <code>`foo`</code></p>
1208 With a code span, ampersands and angle brackets are encoded as HTML
1209 entities automatically, which makes it easy to include example HTML
1210 tags. Markdown will turn this:
1212       Please don't use any `<blink>` tags.
1214 into:
1216       <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
1218 You can write this:
1220       `&#8212;` is the decimal-encoded equivalent of `&mdash;`.
1222 to produce:
1224       <p><code>&amp;#8212;</code> is the decimal-encoded
1225       equivalent of <code>&amp;mdash;</code>.</p>
1228 ~~~~~~
1229 Images
1230 ~~~~~~
1232 Admittedly, it's fairly difficult to devise a "natural" syntax for
1233 placing images into a plain text document format.
1235 Markdown uses an image syntax that is intended to resemble the syntax
1236 for links, allowing for two styles: *inline* and *reference*.
1238 Inline image syntax looks like this:
1240       ![Alt text](/path/to/img.jpg)
1242       ![Alt text](/path/to/img.jpg "Optional title")
1244 That is:
1246 *   An exclamation mark: `!`;
1247 *   followed by a set of square brackets, containing the `alt`
1248     attribute text for the image;
1249 *   followed by a set of parentheses, containing the URL or path to
1250     the image, and an optional `title` attribute enclosed in double
1251     or single quotes.
1253 Reference-style image syntax looks like this:
1255       ![Alt text][id]
1257 Where "id" is the name of a defined image reference. Image references
1258 are defined using syntax identical to link references:
1260       [id]: url/to/image  "Optional title attribute"
1262 To specify one or both dimensions of an image, include the dimensions
1263 in parentheses at the end of the title like so:
1265       [id]: url/to/image  "Optional title attribute (512x342)"
1267 To resize in just one dimension, specify the other as a "?" like so:
1269       [id]: url/to/image  "Optional title attribute (?x342)"
1270       [id]: url/to/image  "Optional title attribute (512x?)"
1272 The first dimension sets the "width" attribute and the second
1273 dimension sets the "height" attribute.  The dimensions are then
1274 removed from the "title" attribute.
1276 To float an image to the left or right include a "(<)" for left or
1277 "(>)" for right at the end of the title like so:
1279       [id]: url/to/image  "Optional title attribute (<)"
1280       [id]: url/to/image  "Optional title attribute (>)"
1282 These can be combined with the image dimensions like so:
1284       [id]: url/to/image  "Optional title attribute (<512x342)"
1285       [id]: url/to/image  "Optional title attribute (<?x342)"
1286       [id]: url/to/image  "Optional title attribute (<512x?)"
1287       [id]: url/to/image  "Optional title attribute (512x342>)"
1288       [id]: url/to/image  "Optional title attribute (?x342>)"
1289       [id]: url/to/image  "Optional title attribute (512x?>)"
1291 Providing both the "float left" (<) and "float right" (>) annotations
1292 at the same time will cause the image to end up centered in its
1293 own "div" like so:
1295       [id]: url/to/image  "Optional title attribute (<>)"
1296       [id]: url/to/image  "Optional title attribute (<512x342>)"
1298 It's possible to wrap the url when it's specified in a reference.
1299 Both of these examples:
1301       [id]: url/\
1302             t\
1303             o/image
1304             "Optional title"
1306       [id]: url/to/image "Optional title"
1308 Produce identical "img" tags.  Only the url can be wrapped and
1309 only when it's in a reference.  The backslash ("\") must be the
1310 last character on the line and the next line (after optional
1311 ignored leading whitespace) must contain at least one additional
1312 character that's part of the URL.
1314 This can be useful for data: urls like so:
1316       ![image][1]
1318       [1]: data:image/gif;base64,R0lGODlhFwAXAPMAMf///+7u7t3d3czMzLu7u6qqqp\
1319            mZmYiIiHd3d2ZmZlVVVURERDMzMyIiIhEREQAAACwAAAAAFwAXAAAExxDISau9Mg\
1320            She8DURhhHWRLDB26FkSjKqxxFqlbBWOwF4fOGgsCycRkInI+ocEAQNBNWq0caCJ\
1321            i9aSqqGwwIL4MAsRATeMMMEykYHBLIt7DNHETrAPrBihVwDAh2ansBXygaAj5sa1\
1322            x7iTUAKomEBU53B0hGVoVMTleEg0hkCD0DJAhwAlVcQT6nLwgHR1liUQNaqgkMDT\
1323            NWXWkSbS6lZ0eKTUIWuTSbGzlNlkS3LSYksjtPK6YJCzEwNMAgbT9nKBwg6Onq6B\
1324            EAOw== "title (100x100)"
1326 Thus allowing small amounts of image data to be embedded directly in the
1327 source "text" file with minimal fuss.
1330 - - - - -
1333 -------------
1334 Miscellaneous
1335 -------------
1337 ~~~~~~~~~~~~~~~
1338 Automatic Links
1339 ~~~~~~~~~~~~~~~
1341 Markdown supports a shortcut style for creating "automatic" links for URLs
1342 and email addresses: simply surround the URL or email address with angle
1343 brackets or don't. What this means is that if you want to show the actual text
1344 of a URL or email address, and also have it be a clickable link, you can do:
1346       <http://example.com/>
1348 or this:
1350       http://example.com/
1352 Markdown will turn that into:
1354       &lt;<a href="http://example.com/">http://example.com/</a>&gt;
1356 or this:
1358       <a href="http://example.com/">http://example.com/</a>
1360 If Markdown is not quite grabbing the right link when it's not surrounded
1361 by angle brackets then just add the angle brackets to avoid the guessing.
1363 Automatic links for email addresses work similarly, except that
1364 Markdown will also perform a bit of randomized decimal and hex
1365 entity-encoding to help obscure your address from address-harvesting
1366 spambots. For example, Markdown will turn this:
1368       <address@example.com>
1370 into something like this:
1372       <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
1373       &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
1374       &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
1375       &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
1377 which will render in a browser as a clickable link to "address@example.com".
1379 (This sort of entity-encoding trick will indeed fool many, if not
1380 most, address-harvesting bots, but it definitely won't fool all of
1381 them. It's better than nothing, but an address published in this way
1382 will probably eventually start receiving spam.)
1385 ~~~~~~~~~~~~~~~~~
1386 Backslash Escapes
1387 ~~~~~~~~~~~~~~~~~
1389 Markdown allows you to use backslash escapes to generate literal
1390 characters which would otherwise have special meaning in Markdown's
1391 formatting syntax. For example, if you wanted to surround a word
1392 with literal asterisks (instead of an HTML `<em>` tag), you can use
1393 backslashes before the asterisks, like this:
1395       \*literal asterisks\*
1397 Markdown provides backslash escapes for the following characters:
1399       \   backslash
1400       `   backtick
1401       *   asterisk
1402       _   underscore
1403       ~   tilde
1404       {}  curly braces
1405       []  square brackets
1406       ()  parentheses
1407       #   hash mark
1408       +   plus sign
1409       -   minus sign (hyphen)
1410       .   dot
1411       !   exclamation mark
1412       |   vertical bar (escape only needed/recognized in tables)
1415 ~~~~~~~~~~~~
1416 XML Comments
1417 ~~~~~~~~~~~~
1419 [XML format comments][xml] may be used and, by default, will be
1420 passed through unchanged to the output (there's a non-default option
1421 available to remove them instead).
1423 However, to be recognized, they must match the [XML comments
1424 specification][xml] and _MUST NOT_ appear inside [code blocks] or
1425 be inside a [code] span where they are automatically escaped.
1427 Specifically, they must start with the "XML comment begin tag"
1428 `<!--` and end with the "XML comment end tag" `-->` and they _MUST
1429 NOT_ contain any double-hyphen sequences, "--", after the "XML
1430 comment begin tag" except when it's immediately followed by a right
1431 angle bracket `>` which means it's the "XML comment end tag".
1433 In other words, all of these are valid XML comments:
1435     <!-- -->
1436     <!-- - -->
1437     <!-- - - - - - - - - - - -->
1438     <!---->
1439     <!--- -->
1440     <!-- comment -->
1441     <!--also-a-comment-->
1443 But _none of these are valid XML comments_:
1445     <!----->
1446     <!-- --->
1447     <!-- -- -->
1448     <!------------------------->
1449     <!-- invalid--double-hyphens -->
1450     <!--invalid--yes-->
1452 If an invalid XML comment is present, it will be recognized as such
1453 and the initial leading left angle bracket `<` will be automatically
1454 escaped resulting in the entire invalid XML comment being passed
1455 through to the output as ordinary, non-comment, plain text.
1457 Run `Markdown.pl` with the `--strip-comments` option to remove XML
1458 comments from the final output.
1461 [xml]: <https://www.w3.org/TR/xml/#sec-comments>
1462        "XML Comments Specification"
1465 ~~~~~~~~~~~~~~~~~
1466 YAML Front Matter
1467 ~~~~~~~~~~~~~~~~~
1469 Unless disabled (see `Markdown.pl --help`), by default any YAML
1470 front matter that may be present will be stripped and processed
1471 before handling the rest of the document.
1473 To add YAML front matter, the very first line of the document
1474 must be exactly three (3) hyphens (`---`).
1476 The YAML front matter continues until a line consisting of
1477 exactly three (3) hyphens (`---`) or dots (`...`) or the end
1478 of the document is encountered.
1480 For maximum compatibility with some other markdown processors,
1481 end the YAML front matter with three (3) hyphens (`---`).
1483 Only very basic YAML processing directives are recognized:
1485   * Blank lines
1486   * YAML comments
1487   * `key: ` _<value>_
1489 The _<value>_ part may be either bare or inside double quotes
1490 (in which case standard escapes are recognized).
1492 For example this document:
1494       ---
1495       # This is a YAML comment
1496       title: This Is The Title
1497       ...
1498       This is the first *markdown* format line.
1500 contains YAML front matter that specifies a "title" value of
1501 "This Is The Title".
1503 This document:
1505       ---
1506       title: "Yes, Quoted\tTitle"
1507       header_enum: true # comments allowed here too
1509       # If display_metadata is set to true, then
1510       # all YAML front matter values will be shown in
1511       # a table prefixed to the output document.
1512       #
1513       # If display_metadata is set to false, then
1514       # no such table will ever be prefixed to the output.
1515       #
1516       # If display_metadata is not set, then a table will
1517       # only be prefixed if any unknown settings are encountered.
1519       display_metadata: true
1520       ---
1521       # Main Header
1522       first paragraph
1524       Sub Header
1525       ----------
1527       first sub paragraph
1529       ## Another Sub
1531       second sub paragraph
1533       Second Header
1534       =============
1536       third sub
1537       ---------
1539       sub sub para
1540       ~~~~~~~~~~~~
1542       first sub sub paragraph
1544 will produce this output:
1546       <table>
1547       <tr><th>display_metadata</th><th>header_enum</th><th>title</th></tr>
1548       <tr><td>true</td><td>true</td><td>Yes, Quoted     Title</td></tr>
1549       </table>
1550       <h1>1 Main Header</h1>
1551       <p>first paragraph</p>
1552       <h2>1.1 Sub Header</h2>
1553       <p>first sub paragraph</p>
1554       <h2>1.2 Another Sub</h2>
1555       <p>second sub paragraph</p>
1556       <h1>2 Second Header</h1>
1557       <h2>2.1 third sub</h2>
1558       <h3>2.1.1 sub sub para</h3>
1559       <p>first sub sub paragraph</p>
1561 Notice that a table of metadata was prefixed because `header_enum`
1562 was set to `true` in the YAML front matter.
1564 Additionally, the headers were automatically numbered in a hierarchical
1565 fashion.
1567 If the output document was generated using `Markdown.pl --stub` then the
1568 title as shown in the prefixed table would have been used for the `<title>`
1569 of the document -- notice how the `\t` was expanded to a real tab character.