Period: .
28 |
29 | These should get escaped, even though they're matching pairs for
106 | other Markdown constructs:
107 |
108 | Regular text.
5 |
6 | Regular text.
10 |
11 | Regular Text.
16 |
17 | `
2 |
3 | Fix for backticks within HTML tag: like this
4 |
5 | Here's how you put `` `backticks` `` in a code span.
6 |
7 |
--------------------------------------------------------------------------------
/test/tests/def_blocks.html:
--------------------------------------------------------------------------------
1 |
2 | hello
3 | [1]: hello
4 |
5 |
6 |
7 |
8 |
9 | hello
10 |
11 |
12 |
13 |
14 | - hello
15 | - [3]: hello
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 | foo
26 | bar
27 | bar
28 |
29 |
--------------------------------------------------------------------------------
/test/tests/def_blocks.text:
--------------------------------------------------------------------------------
1 | > hello
2 | > [1]: hello
3 |
4 | * * *
5 |
6 | > hello
7 | [2]: hello
8 |
9 |
10 | * hello
11 | * [3]: hello
12 |
13 |
14 | * hello
15 | [4]: hello
16 |
17 |
18 | > foo
19 | > bar
20 | [1]: foo
21 | > bar
22 |
--------------------------------------------------------------------------------
/test/tests/double_link.html:
--------------------------------------------------------------------------------
1 | Already linked: http://example.com/.
2 |
3 | Already linked: http://example.com/.
4 |
5 | Already linked: http://example.com/.
6 |
--------------------------------------------------------------------------------
/test/tests/double_link.text:
--------------------------------------------------------------------------------
1 | Already linked: http://example.com/.
2 |
3 | Already linked: [http://example.com/](http://example.com/).
4 |
5 | Already linked: **http://example.com/**.
6 |
--------------------------------------------------------------------------------
/test/tests/escaped_angles.html:
--------------------------------------------------------------------------------
1 | >
2 |
--------------------------------------------------------------------------------
/test/tests/escaped_angles.text:
--------------------------------------------------------------------------------
1 | \>
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_break.html:
--------------------------------------------------------------------------------
1 | Look at the
pretty line
breaks.
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_break.text:
--------------------------------------------------------------------------------
1 | Look at the
2 | pretty line
3 | breaks.
4 |
--------------------------------------------------------------------------------
/test/tests/gfm_code.html:
--------------------------------------------------------------------------------
1 | var a = 'hello';
2 | console.log(a + ' world');
3 | echo "hello, ${WORLD}"
4 | Q: What do you call a tall person who sells stolen goods?
5 | A longfence!
6 |
--------------------------------------------------------------------------------
/test/tests/gfm_code.text:
--------------------------------------------------------------------------------
1 | ``` js
2 | var a = 'hello';
3 | console.log(a + ' world');
4 | ```
5 |
6 | ~~~bash
7 | echo "hello, ${WORLD}"
8 | ~~~
9 |
10 | ```````longfence
11 | Q: What do you call a tall person who sells stolen goods?
12 | ```````
13 |
14 | ~~~~~~~~~~ ManyTildes
15 | A longfence!
16 | ~~~~~~~~~~
17 |
--------------------------------------------------------------------------------
/test/tests/gfm_code_hr_list.html:
--------------------------------------------------------------------------------
1 | foo
2 |
3 | bar:
4 |
5 |
6 | - one
7 | - two
8 | - three
9 | - four
10 | - five
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | foo:
19 | line 1
20 | line 2
21 |
22 | foo:
23 |
24 | foo bar
bar:
25 | some code here
26 |
27 |
28 | foo bar
bar:
29 | foo
30 | ---
31 | bar
32 | ---
33 | foo
34 | bar
35 |
36 | foo bar
bar:
37 | ---
38 | foo
39 | foo
40 | ---
41 | bar
42 |
43 | foo bar
bar:
44 | foo
45 | ---
46 | bar
47 |
48 | foo
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/test/tests/gfm_code_hr_list.text:
--------------------------------------------------------------------------------
1 | ## foo
2 |
3 | 1. bar:
4 |
5 | > - one
6 | - two
7 | - three
8 | - four
9 | - five
10 |
11 | 1. foo:
12 |
13 | ```
14 | line 1
15 | line 2
16 | ```
17 |
18 | 1. foo:
19 |
20 | 1. foo `bar` bar:
21 |
22 | ``` erb
23 | some code here
24 | ```
25 |
26 | 2. foo `bar` bar:
27 |
28 | ``` erb
29 | foo
30 | ---
31 | bar
32 | ---
33 | foo
34 | bar
35 | ```
36 |
37 | 3. foo `bar` bar:
38 |
39 | ``` html
40 | ---
41 | foo
42 | foo
43 | ---
44 | bar
45 | ```
46 |
47 | 4. foo `bar` bar:
48 |
49 | foo
50 | ---
51 | bar
52 |
53 | 5. foo
54 |
--------------------------------------------------------------------------------
/test/tests/gfm_del.html:
--------------------------------------------------------------------------------
1 | hello hi world
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_del.text:
--------------------------------------------------------------------------------
1 | hello ~~hi~~ world
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_em.html:
--------------------------------------------------------------------------------
1 | These words should_not_be_emphasized.
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_em.text:
--------------------------------------------------------------------------------
1 | These words should_not_be_emphasized.
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_links.html:
--------------------------------------------------------------------------------
1 | This should be a link:
2 | http://example.com/hello-world.
3 |
--------------------------------------------------------------------------------
/test/tests/gfm_links.text:
--------------------------------------------------------------------------------
1 | This should be a link: http://example.com/hello-world.
2 |
--------------------------------------------------------------------------------
/test/tests/gfm_tables.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Heading 1 | Heading 2 |
4 |
5 |
6 | Cell 1 | Cell 2 |
7 | Cell 3 | Cell 4 |
8 |
9 |
10 |
11 |
12 | Header 1 | Header 2 | Header 3 | Header 4 |
13 |
14 |
15 | Cell 1 | Cell 2 | Cell 3 | Cell 4 |
16 | Cell 5 | Cell 6 | Cell 7 | Cell 8 |
17 |
18 |
19 | Test code
20 |
21 |
22 | Header 1 | Header 2 |
23 |
24 |
25 | Cell 1 | Cell 2 |
26 | Cell 3 | Cell 4 |
27 |
28 |
29 |
30 |
31 | Header 1 | Header 2 | Header 3 | Header 4 |
32 |
33 |
34 | Cell 1 | Cell 2 | Cell 3 | Cell 4 |
35 | Cell 5 | Cell 6 | Cell 7 | Cell 8 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/test/tests/gfm_tables.text:
--------------------------------------------------------------------------------
1 | | Heading 1 | Heading 2
2 | | --------- | ---------
3 | | Cell 1 | Cell 2
4 | | Cell 3 | Cell 4
5 |
6 | | Header 1 | Header 2 | Header 3 | Header 4 |
7 | | :------: | -------: | :------- | -------- |
8 | | Cell 1 | Cell 2 | Cell 3 | Cell 4 |
9 | | Cell 5 | Cell 6 | Cell 7 | Cell 8 |
10 |
11 | Test code
12 |
13 | Header 1 | Header 2
14 | -------- | --------
15 | Cell 1 | Cell 2
16 | Cell 3 | Cell 4
17 |
18 | Header 1|Header 2|Header 3|Header 4
19 | :-------|:------:|-------:|--------
20 | Cell 1 |Cell 2 |Cell 3 |Cell 4
21 | *Cell 5*|Cell 6 |Cell 7 |Cell 8
22 |
--------------------------------------------------------------------------------
/test/tests/hard_wrapped_paragraphs_with_list_like_lines.html:
--------------------------------------------------------------------------------
1 | In Markdown 1.0.0 and earlier. Version
2 | 8. This line turns into a list item.
3 | Because a hard-wrapped line in the
4 | middle of a paragraph looked like a
5 | list item.
6 |
7 | Here's one with a bullet.
8 | * criminey.
9 |
--------------------------------------------------------------------------------
/test/tests/hard_wrapped_paragraphs_with_list_like_lines.text:
--------------------------------------------------------------------------------
1 | In Markdown 1.0.0 and earlier. Version
2 | 8. This line turns into a list item.
3 | Because a hard-wrapped line in the
4 | middle of a paragraph looked like a
5 | list item.
6 |
7 | Here's one with a bullet.
8 | * criminey.
9 |
--------------------------------------------------------------------------------
/test/tests/horizontal_rules.html:
--------------------------------------------------------------------------------
1 | Dashes:
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | ---
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | - - -
23 |
24 |
25 | Asterisks:
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ***
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | * * *
47 |
48 |
49 | Underscores:
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | ___
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | _ _ _
71 |
72 |
--------------------------------------------------------------------------------
/test/tests/horizontal_rules.text:
--------------------------------------------------------------------------------
1 | Dashes:
2 |
3 | ---
4 |
5 | ---
6 |
7 | ---
8 |
9 | ---
10 |
11 | ---
12 |
13 | - - -
14 |
15 | - - -
16 |
17 | - - -
18 |
19 | - - -
20 |
21 | - - -
22 |
23 |
24 | Asterisks:
25 |
26 | ***
27 |
28 | ***
29 |
30 | ***
31 |
32 | ***
33 |
34 | ***
35 |
36 | * * *
37 |
38 | * * *
39 |
40 | * * *
41 |
42 | * * *
43 |
44 | * * *
45 |
46 |
47 | Underscores:
48 |
49 | ___
50 |
51 | ___
52 |
53 | ___
54 |
55 | ___
56 |
57 | ___
58 |
59 | _ _ _
60 |
61 | _ _ _
62 |
63 | _ _ _
64 |
65 | _ _ _
66 |
67 | _ _ _
68 |
--------------------------------------------------------------------------------
/test/tests/hr_list_break.html:
--------------------------------------------------------------------------------
1 |
2 | - hello
3 | world
4 | - how
5 | are
6 |
7 |
8 |
9 |
10 | you today?
11 |
--------------------------------------------------------------------------------
/test/tests/hr_list_break.text:
--------------------------------------------------------------------------------
1 | * hello
2 | world
3 | * how
4 | are
5 | * * *
6 | you today?
7 |
--------------------------------------------------------------------------------
/test/tests/inline_html_advanced.html:
--------------------------------------------------------------------------------
1 | Simple block on one line:
2 |
3 | foo
4 |
5 | And nested without indentation:
6 |
7 |
8 |
9 |
10 | foo
11 |
12 |
13 |
14 |
bar
15 |
16 |
--------------------------------------------------------------------------------
/test/tests/inline_html_advanced.text:
--------------------------------------------------------------------------------
1 | Simple block on one line:
2 |
3 | foo
4 |
5 | And nested without indentation:
6 |
7 |
8 |
9 |
10 | foo
11 |
12 |
13 |
14 |
bar
15 |
16 |
--------------------------------------------------------------------------------
/test/tests/inline_html_comments.html:
--------------------------------------------------------------------------------
1 | Paragraph one.
2 |
3 |
4 |
5 |
8 |
9 | Paragraph two.
10 |
11 |
12 |
13 | The end.
14 |
--------------------------------------------------------------------------------
/test/tests/inline_html_comments.text:
--------------------------------------------------------------------------------
1 | Paragraph one.
2 |
3 |
4 |
5 |
8 |
9 | Paragraph two.
10 |
11 |
12 |
13 | The end.
14 |
--------------------------------------------------------------------------------
/test/tests/inline_html_simple.html:
--------------------------------------------------------------------------------
1 | Here's a simple block:
2 |
3 |
4 | foo
5 |
6 |
7 | This should be a code block, though:
8 |
9 | <div>
10 | foo
11 | </div>
12 |
13 |
14 | As should this:
15 |
16 | <div>foo</div>
17 |
18 |
19 | Now, nested:
20 |
21 |
28 |
29 | This should just be an HTML comment:
30 |
31 |
32 |
33 | Multiline:
34 |
35 |
39 |
40 | Code block:
41 |
42 | <!-- Comment -->
43 |
44 |
45 | Just plain comment, with trailing spaces on the line:
46 |
47 |
48 |
49 | Code:
50 |
51 | <hr>
52 |
53 |
54 | Hr's:
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/test/tests/inline_html_simple.text:
--------------------------------------------------------------------------------
1 | Here's a simple block:
2 |
3 |
4 | foo
5 |
6 |
7 | This should be a code block, though:
8 |
9 |
10 | foo
11 |
12 |
13 | As should this:
14 |
15 | foo
16 |
17 | Now, nested:
18 |
19 |
26 |
27 | This should just be an HTML comment:
28 |
29 |
30 |
31 | Multiline:
32 |
33 |
37 |
38 | Code block:
39 |
40 |
41 |
42 | Just plain comment, with trailing spaces on the line:
43 |
44 |
45 |
46 | Code:
47 |
48 |
49 |
50 | Hr's:
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/test/tests/lazy_blockquotes.html:
--------------------------------------------------------------------------------
1 |
2 | hi there
3 | bud
4 |
5 |
--------------------------------------------------------------------------------
/test/tests/lazy_blockquotes.text:
--------------------------------------------------------------------------------
1 | > hi there
2 | bud
3 |
--------------------------------------------------------------------------------
/test/tests/links_inline_style.html:
--------------------------------------------------------------------------------
1 | Just a URL.
2 |
3 | URL and title.
4 |
5 | URL and title.
6 |
7 | URL and title.
8 |
9 | URL and title.
10 |
11 | Empty.
12 |
--------------------------------------------------------------------------------
/test/tests/links_inline_style.text:
--------------------------------------------------------------------------------
1 | Just a [URL](/url/).
2 |
3 | [URL and title](/url/ "title").
4 |
5 | [URL and title](/url/ "title preceded by two spaces").
6 |
7 | [URL and title](/url/ "title preceded by a tab").
8 |
9 | [URL and title](/url/ "title has spaces afterward" ).
10 |
11 |
12 | [Empty]().
13 |
--------------------------------------------------------------------------------
/test/tests/links_reference_style.html:
--------------------------------------------------------------------------------
1 | Foo bar.
2 |
3 | Foo bar.
4 |
5 | Foo bar.
6 |
7 | With embedded [brackets].
8 |
9 | Indented once.
10 |
11 | Indented twice.
12 |
13 | Indented thrice.
14 |
15 | Indented [four][] times.
16 |
17 | [four]: /url
18 |
19 |
20 |
21 |
22 | this should work
23 |
24 | So should this.
25 |
26 | And this.
27 |
28 | And this.
29 |
30 | And this.
31 |
32 | But not [that] [].
33 |
34 | Nor [that][].
35 |
36 | Nor [that].
37 |
38 | [Something in brackets like this should work]
39 |
40 | [Same with this.]
41 |
42 | In this case, this points to something else.
43 |
44 | Backslashing should suppress [this] and [this].
45 |
46 |
47 |
48 | Here's one where the link
49 | breaks across lines.
50 |
51 | Here's another where the link
52 | breaks across lines, but with a line-ending space.
53 |
--------------------------------------------------------------------------------
/test/tests/links_reference_style.text:
--------------------------------------------------------------------------------
1 | Foo [bar] [1].
2 |
3 | Foo [bar][1].
4 |
5 | Foo [bar]
6 | [1].
7 |
8 | [1]: /url/ "Title"
9 |
10 |
11 | With [embedded [brackets]] [b].
12 |
13 |
14 | Indented [once][].
15 |
16 | Indented [twice][].
17 |
18 | Indented [thrice][].
19 |
20 | Indented [four][] times.
21 |
22 | [once]: /url
23 |
24 | [twice]: /url
25 |
26 | [thrice]: /url
27 |
28 | [four]: /url
29 |
30 |
31 | [b]: /url/
32 |
33 | * * *
34 |
35 | [this] [this] should work
36 |
37 | So should [this][this].
38 |
39 | And [this] [].
40 |
41 | And [this][].
42 |
43 | And [this].
44 |
45 | But not [that] [].
46 |
47 | Nor [that][].
48 |
49 | Nor [that].
50 |
51 | [Something in brackets like [this][] should work]
52 |
53 | [Same with [this].]
54 |
55 | In this case, [this](/somethingelse/) points to something else.
56 |
57 | Backslashing should suppress \[this] and [this\].
58 |
59 | [this]: foo
60 |
61 |
62 | * * *
63 |
64 | Here's one where the [link
65 | breaks] across lines.
66 |
67 | Here's another where the [link
68 | breaks] across lines, but with a line-ending space.
69 |
70 |
71 | [link breaks]: /url/
72 |
--------------------------------------------------------------------------------
/test/tests/links_shortcut_references.html:
--------------------------------------------------------------------------------
1 | This is the simple case.
2 |
3 | This one has a line
4 | break.
5 |
6 | This one has a line
7 | break with a line-ending space.
8 |
9 | this and the other
10 |
--------------------------------------------------------------------------------
/test/tests/links_shortcut_references.text:
--------------------------------------------------------------------------------
1 | This is the [simple case].
2 |
3 | [simple case]: /simple
4 |
5 |
6 |
7 | This one has a [line
8 | break].
9 |
10 | This one has a [line
11 | break] with a line-ending space.
12 |
13 | [line break]: /foo
14 |
15 |
16 | [this] [that] and the [other]
17 |
18 | [this]: /this
19 | [that]: /that
20 | [other]: /other
21 |
--------------------------------------------------------------------------------
/test/tests/list_item_text.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/tests/list_item_text.text:
--------------------------------------------------------------------------------
1 | * item1
2 |
3 | * item2
4 |
5 | text
6 |
--------------------------------------------------------------------------------
/test/tests/literal_quotes_in_titles.html:
--------------------------------------------------------------------------------
1 | Foo bar.
2 |
3 | Foo bar.
4 |
--------------------------------------------------------------------------------
/test/tests/literal_quotes_in_titles.text:
--------------------------------------------------------------------------------
1 | Foo [bar][].
2 |
3 | Foo [bar](/url/ "Title with "quotes" inside").
4 |
5 |
6 | [bar]: /url/ "Title with "quotes" inside"
7 |
8 |
--------------------------------------------------------------------------------
/test/tests/loose_lists.html:
--------------------------------------------------------------------------------
1 |
2 | hello
3 | world
4 |
5 | how
6 | are
7 | - you
8 |
9 |
10 |
11 |
12 | better behavior:
13 |
14 | hello
world
15 | how
are
16 | you
today
- hi
17 |
18 |
19 |
20 |
21 | hello
22 | world
23 | - hi
24 |
25 |
26 |
27 |
28 |
29 | - hello
30 | world
31 | hi
32 |
33 |
34 |
35 |
36 |
37 | - hello
38 | world
39 |
40 | how
41 | - hi
42 |
43 |
44 |
45 |
46 |
47 | - hello
48 | - world
49 | how
50 |
51 | are
52 |
53 |
54 |
55 |
56 |
57 | - hello
58 | world
59 | how
60 |
61 | are
62 |
63 |
--------------------------------------------------------------------------------
/test/tests/loose_lists.text:
--------------------------------------------------------------------------------
1 | * hello
2 | world
3 |
4 | how
5 | are
6 | * you
7 |
8 |
9 |
10 | better behavior:
11 |
12 | * hello
13 | * world
14 | how
15 |
16 | are
17 | you
18 |
19 | * today
20 | * hi
21 |
22 |
23 |
24 | * hello
25 |
26 | * world
27 | * hi
28 |
29 |
30 |
31 | * hello
32 | * world
33 |
34 | * hi
35 |
36 |
37 |
38 | * hello
39 | * world
40 |
41 | how
42 | * hi
43 |
44 |
45 |
46 | * hello
47 | * world
48 | * how
49 |
50 | are
51 |
52 |
53 |
54 | * hello
55 | * world
56 |
57 | * how
58 |
59 | are
60 |
--------------------------------------------------------------------------------
/test/tests/main.html:
--------------------------------------------------------------------------------
1 | A heading
Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.
A link. Not anymore.
Paragraph.
- bq Item 1
- bq Item 2
- New bq Item 1
- New bq Item 2 Text here
Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again
Another Heading
Hello world. Here is a link. And an image
.
Code goes here.
4 | Lots of it...
5 |
--------------------------------------------------------------------------------
/test/tests/main.text:
--------------------------------------------------------------------------------
1 | [test]: http://google.com/ "Google"
2 |
3 | # A heading
4 |
5 | Just a note, I've found that I can't test my markdown parser vs others.
6 | For example, both markdown.js and showdown code blocks in lists wrong. They're
7 | also completely [inconsistent][test] with regards to paragraphs in list items.
8 |
9 | A link. Not anymore.
10 |
11 |
13 |
14 | * List Item 1
15 |
16 | * List Item 2
17 | * New List Item 1
18 | Hi, this is a list item.
19 | * New List Item 2
20 | Another item
21 | Code goes here.
22 | Lots of it...
23 | * New List Item 3
24 | The last item
25 |
26 | * List Item 3
27 | The final item.
28 |
29 | * List Item 4
30 | The real final item.
31 |
32 | Paragraph.
33 |
34 | > * bq Item 1
35 | > * bq Item 2
36 | > * New bq Item 1
37 | > * New bq Item 2
38 | > Text here
39 |
40 | * * *
41 |
42 | > Another blockquote!
43 | > I really need to get
44 | > more creative with
45 | > mockup text..
46 | > markdown.js breaks here again
47 |
48 | Another Heading
49 | -------------
50 |
51 | Hello *world*. Here is a [link](//hello).
52 | And an image .
53 |
54 | Code goes here.
55 | Lots of it...
56 |
--------------------------------------------------------------------------------
/test/tests/markdown_documentation_basics.html:
--------------------------------------------------------------------------------
1 | Markdown: Basics
2 |
3 |
10 |
11 | Getting the Gist of Markdown's Formatting Syntax
12 |
13 | This page offers a brief overview of what it's like to use Markdown.
14 | The syntax page provides complete, detailed documentation for
15 | every feature, but Markdown should be very easy to pick up simply by
16 | looking at a few examples of it in action. The examples on this page
17 | are written in a before/after style, showing example syntax and the
18 | HTML output produced by Markdown.
19 |
20 | It's also helpful to simply try Markdown out; the Dingus is a
21 | web application that allows you type your own Markdown-formatted text
22 | and translate it to XHTML.
23 |
24 | Note: This document is itself written using Markdown; you
25 | can see the source for it by adding '.text' to the URL.
26 |
27 | Paragraphs, Headers, Blockquotes
28 |
29 | A paragraph is simply one or more consecutive lines of text, separated
30 | by one or more blank lines. (A blank line is any line that looks like a
31 | blank line -- a line containing nothing spaces or tabs is considered
32 | blank.) Normal paragraphs should not be intended with spaces or tabs.
33 |
34 | Markdown offers two styles of headers: Setext and atx.
35 | Setext-style headers for <h1>
and <h2>
are created by
36 | "underlining" with equal signs (=
) and hyphens (-
), respectively.
37 | To create an atx-style header, you put 1-6 hash marks (#
) at the
38 | beginning of the line -- the number of hashes equals the resulting
39 | HTML header level.
40 |
41 | Blockquotes are indicated using email-style '>
' angle brackets.
42 |
43 | Markdown:
44 |
45 | A First Level Header
46 | ====================
47 |
48 | A Second Level Header
49 | ---------------------
50 |
51 | Now is the time for all good men to come to
52 | the aid of their country. This is just a
53 | regular paragraph.
54 |
55 | The quick brown fox jumped over the lazy
56 | dog's back.
57 |
58 | ### Header 3
59 |
60 | > This is a blockquote.
61 | >
62 | > This is the second paragraph in the blockquote.
63 | >
64 | > ## This is an H2 in a blockquote
65 |
66 |
67 | Output:
68 |
69 | <h1>A First Level Header</h1>
70 |
71 | <h2>A Second Level Header</h2>
72 |
73 | <p>Now is the time for all good men to come to
74 | the aid of their country. This is just a
75 | regular paragraph.</p>
76 |
77 | <p>The quick brown fox jumped over the lazy
78 | dog's back.</p>
79 |
80 | <h3>Header 3</h3>
81 |
82 | <blockquote>
83 | <p>This is a blockquote.</p>
84 |
85 | <p>This is the second paragraph in the blockquote.</p>
86 |
87 | <h2>This is an H2 in a blockquote</h2>
88 | </blockquote>
89 |
90 |
91 | Phrase Emphasis
92 |
93 | Markdown uses asterisks and underscores to indicate spans of emphasis.
94 |
95 | Markdown:
96 |
97 | Some of these words *are emphasized*.
98 | Some of these words _are emphasized also_.
99 |
100 | Use two asterisks for **strong emphasis**.
101 | Or, if you prefer, __use two underscores instead__.
102 |
103 |
104 | Output:
105 |
106 | <p>Some of these words <em>are emphasized</em>.
107 | Some of these words <em>are emphasized also</em>.</p>
108 |
109 | <p>Use two asterisks for <strong>strong emphasis</strong>.
110 | Or, if you prefer, <strong>use two underscores instead</strong>.</p>
111 |
112 |
113 | Lists
114 |
115 | Unordered (bulleted) lists use asterisks, pluses, and hyphens (*
,
116 | +
, and -
) as list markers. These three markers are
117 | interchangable; this:
118 |
119 | * Candy.
120 | * Gum.
121 | * Booze.
122 |
123 |
124 | this:
125 |
126 | + Candy.
127 | + Gum.
128 | + Booze.
129 |
130 |
131 | and this:
132 |
133 | - Candy.
134 | - Gum.
135 | - Booze.
136 |
137 |
138 | all produce the same output:
139 |
140 | <ul>
141 | <li>Candy.</li>
142 | <li>Gum.</li>
143 | <li>Booze.</li>
144 | </ul>
145 |
146 |
147 | Ordered (numbered) lists use regular numbers, followed by periods, as
148 | list markers:
149 |
150 | 1. Red
151 | 2. Green
152 | 3. Blue
153 |
154 |
155 | Output:
156 |
157 | <ol>
158 | <li>Red</li>
159 | <li>Green</li>
160 | <li>Blue</li>
161 | </ol>
162 |
163 |
164 | If you put blank lines between items, you'll get <p>
tags for the
165 | list item text. You can create multi-paragraph list items by indenting
166 | the paragraphs by 4 spaces or 1 tab:
167 |
168 | * A list item.
169 |
170 | With multiple paragraphs.
171 |
172 | * Another item in the list.
173 |
174 |
175 | Output:
176 |
177 | <ul>
178 | <li><p>A list item.</p>
179 | <p>With multiple paragraphs.</p></li>
180 | <li><p>Another item in the list.</p></li>
181 | </ul>
182 |
183 |
184 | Links
185 |
186 | Markdown supports two styles for creating links: inline and
187 | reference. With both styles, you use square brackets to delimit the
188 | text you want to turn into a link.
189 |
190 | Inline-style links use parentheses immediately after the link text.
191 | For example:
192 |
193 | This is an [example link](http://example.com/).
194 |
195 |
196 | Output:
197 |
198 | <p>This is an <a href="http://example.com/">
199 | example link</a>.</p>
200 |
201 |
202 | Optionally, you may include a title attribute in the parentheses:
203 |
204 | This is an [example link](http://example.com/ "With a Title").
205 |
206 |
207 | Output:
208 |
209 | <p>This is an <a href="http://example.com/" title="With a Title">
210 | example link</a>.</p>
211 |
212 |
213 | Reference-style links allow you to refer to your links by names, which
214 | you define elsewhere in your document:
215 |
216 | I get 10 times more traffic from [Google][1] than from
217 | [Yahoo][2] or [MSN][3].
218 |
219 | [1]: http://google.com/ "Google"
220 | [2]: http://search.yahoo.com/ "Yahoo Search"
221 | [3]: http://search.msn.com/ "MSN Search"
222 |
223 |
224 | Output:
225 |
226 | <p>I get 10 times more traffic from <a href="http://google.com/"
227 | title="Google">Google</a> than from <a href="http://search.yahoo.com/"
228 | title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
229 | title="MSN Search">MSN</a>.</p>
230 |
231 |
232 | The title attribute is optional. Link names may contain letters,
233 | numbers and spaces, but are not case sensitive:
234 |
235 | I start my morning with a cup of coffee and
236 | [The New York Times][NY Times].
237 |
238 | [ny times]: http://www.nytimes.com/
239 |
240 |
241 | Output:
242 |
243 | <p>I start my morning with a cup of coffee and
244 | <a href="http://www.nytimes.com/">The New York Times</a>.</p>
245 |
246 |
247 | Images
248 |
249 | Image syntax is very much like link syntax.
250 |
251 | Inline (titles are optional):
252 |
253 | 
254 |
255 |
256 | Reference-style:
257 |
258 | ![alt text][id]
259 |
260 | [id]: /path/to/img.jpg "Title"
261 |
262 |
263 | Both of the above examples produce the same output:
264 |
265 | <img src="/path/to/img.jpg" alt="alt text" title="Title" />
266 |
267 |
268 | Code
269 |
270 | In a regular paragraph, you can create code span by wrapping text in
271 | backtick quotes. Any ampersands (&
) and angle brackets (<
or
272 | >
) will automatically be translated into HTML entities. This makes
273 | it easy to use Markdown to write about HTML example code:
274 |
275 | I strongly recommend against using any `<blink>` tags.
276 |
277 | I wish SmartyPants used named entities like `—`
278 | instead of decimal-encoded entites like `—`.
279 |
280 |
281 | Output:
282 |
283 | <p>I strongly recommend against using any
284 | <code><blink></code> tags.</p>
285 |
286 | <p>I wish SmartyPants used named entities like
287 | <code>&mdash;</code> instead of decimal-encoded
288 | entites like <code>&#8212;</code>.</p>
289 |
290 |
291 | To specify an entire block of pre-formatted code, indent every line of
292 | the block by 4 spaces or 1 tab. Just like with code spans, &
, <
,
293 | and >
characters will be escaped automatically.
294 |
295 | Markdown:
296 |
297 | If you want your page to validate under XHTML 1.0 Strict,
298 | you've got to put paragraph tags in your blockquotes:
299 |
300 | <blockquote>
301 | <p>For example.</p>
302 | </blockquote>
303 |
304 |
305 | Output:
306 |
307 | <p>If you want your page to validate under XHTML 1.0 Strict,
308 | you've got to put paragraph tags in your blockquotes:</p>
309 |
310 | <pre><code><blockquote>
311 | <p>For example.</p>
312 | </blockquote>
313 | </code></pre>
314 |
315 |
--------------------------------------------------------------------------------
/test/tests/markdown_documentation_basics.text:
--------------------------------------------------------------------------------
1 | Markdown: Basics
2 | ================
3 |
4 |
11 |
12 |
13 | Getting the Gist of Markdown's Formatting Syntax
14 | ------------------------------------------------
15 |
16 | This page offers a brief overview of what it's like to use Markdown.
17 | The [syntax page] [s] provides complete, detailed documentation for
18 | every feature, but Markdown should be very easy to pick up simply by
19 | looking at a few examples of it in action. The examples on this page
20 | are written in a before/after style, showing example syntax and the
21 | HTML output produced by Markdown.
22 |
23 | It's also helpful to simply try Markdown out; the [Dingus] [d] is a
24 | web application that allows you type your own Markdown-formatted text
25 | and translate it to XHTML.
26 |
27 | **Note:** This document is itself written using Markdown; you
28 | can [see the source for it by adding '.text' to the URL] [src].
29 |
30 | [s]: /projects/markdown/syntax "Markdown Syntax"
31 | [d]: /projects/markdown/dingus "Markdown Dingus"
32 | [src]: /projects/markdown/basics.text
33 |
34 |
35 | ## Paragraphs, Headers, Blockquotes ##
36 |
37 | A paragraph is simply one or more consecutive lines of text, separated
38 | by one or more blank lines. (A blank line is any line that looks like a
39 | blank line -- a line containing nothing spaces or tabs is considered
40 | blank.) Normal paragraphs should not be intended with spaces or tabs.
41 |
42 | Markdown offers two styles of headers: *Setext* and *atx*.
43 | Setext-style headers for `` and `` are created by
44 | "underlining" with equal signs (`=`) and hyphens (`-`), respectively.
45 | To create an atx-style header, you put 1-6 hash marks (`#`) at the
46 | beginning of the line -- the number of hashes equals the resulting
47 | HTML header level.
48 |
49 | Blockquotes are indicated using email-style '`>`' angle brackets.
50 |
51 | Markdown:
52 |
53 | A First Level Header
54 | ====================
55 |
56 | A Second Level Header
57 | ---------------------
58 |
59 | Now is the time for all good men to come to
60 | the aid of their country. This is just a
61 | regular paragraph.
62 |
63 | The quick brown fox jumped over the lazy
64 | dog's back.
65 |
66 | ### Header 3
67 |
68 | > This is a blockquote.
69 | >
70 | > This is the second paragraph in the blockquote.
71 | >
72 | > ## This is an H2 in a blockquote
73 |
74 |
75 | Output:
76 |
77 | A First Level Header
78 |
79 | A Second Level Header
80 |
81 |
Now is the time for all good men to come to
82 | the aid of their country. This is just a
83 | regular paragraph.
84 |
85 | The quick brown fox jumped over the lazy
86 | dog's back.
87 |
88 | Header 3
89 |
90 |
91 | This is a blockquote.
92 |
93 | This is the second paragraph in the blockquote.
94 |
95 | This is an H2 in a blockquote
96 |
97 |
98 |
99 |
100 | ### Phrase Emphasis ###
101 |
102 | Markdown uses asterisks and underscores to indicate spans of emphasis.
103 |
104 | Markdown:
105 |
106 | Some of these words *are emphasized*.
107 | Some of these words _are emphasized also_.
108 |
109 | Use two asterisks for **strong emphasis**.
110 | Or, if you prefer, __use two underscores instead__.
111 |
112 | Output:
113 |
114 | Some of these words are emphasized.
115 | Some of these words are emphasized also.
116 |
117 | Use two asterisks for strong emphasis.
118 | Or, if you prefer, use two underscores instead.
119 |
120 |
121 |
122 | ## Lists ##
123 |
124 | Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
125 | `+`, and `-`) as list markers. These three markers are
126 | interchangable; this:
127 |
128 | * Candy.
129 | * Gum.
130 | * Booze.
131 |
132 | this:
133 |
134 | + Candy.
135 | + Gum.
136 | + Booze.
137 |
138 | and this:
139 |
140 | - Candy.
141 | - Gum.
142 | - Booze.
143 |
144 | all produce the same output:
145 |
146 |
147 | - Candy.
148 | - Gum.
149 | - Booze.
150 |
151 |
152 | Ordered (numbered) lists use regular numbers, followed by periods, as
153 | list markers:
154 |
155 | 1. Red
156 | 2. Green
157 | 3. Blue
158 |
159 | Output:
160 |
161 |
162 | - Red
163 | - Green
164 | - Blue
165 |
166 |
167 | If you put blank lines between items, you'll get `` tags for the
168 | list item text. You can create multi-paragraph list items by indenting
169 | the paragraphs by 4 spaces or 1 tab:
170 |
171 | * A list item.
172 |
173 | With multiple paragraphs.
174 |
175 | * Another item in the list.
176 |
177 | Output:
178 |
179 |
184 |
185 |
186 |
187 | ### Links ###
188 |
189 | Markdown supports two styles for creating links: *inline* and
190 | *reference*. With both styles, you use square brackets to delimit the
191 | text you want to turn into a link.
192 |
193 | Inline-style links use parentheses immediately after the link text.
194 | For example:
195 |
196 | This is an [example link](http://example.com/).
197 |
198 | Output:
199 |
200 | This is an
201 | example link.
202 |
203 | Optionally, you may include a title attribute in the parentheses:
204 |
205 | This is an [example link](http://example.com/ "With a Title").
206 |
207 | Output:
208 |
209 | This is an
210 | example link.
211 |
212 | Reference-style links allow you to refer to your links by names, which
213 | you define elsewhere in your document:
214 |
215 | I get 10 times more traffic from [Google][1] than from
216 | [Yahoo][2] or [MSN][3].
217 |
218 | [1]: http://google.com/ "Google"
219 | [2]: http://search.yahoo.com/ "Yahoo Search"
220 | [3]: http://search.msn.com/ "MSN Search"
221 |
222 | Output:
223 |
224 | I get 10 times more traffic from Google than from Yahoo or MSN.
228 |
229 | The title attribute is optional. Link names may contain letters,
230 | numbers and spaces, but are *not* case sensitive:
231 |
232 | I start my morning with a cup of coffee and
233 | [The New York Times][NY Times].
234 |
235 | [ny times]: http://www.nytimes.com/
236 |
237 | Output:
238 |
239 | I start my morning with a cup of coffee and
240 | The New York Times.
241 |
242 |
243 | ### Images ###
244 |
245 | Image syntax is very much like link syntax.
246 |
247 | Inline (titles are optional):
248 |
249 | 
250 |
251 | Reference-style:
252 |
253 | ![alt text][id]
254 |
255 | [id]: /path/to/img.jpg "Title"
256 |
257 | Both of the above examples produce the same output:
258 |
259 |
260 |
261 |
262 |
263 | ### Code ###
264 |
265 | In a regular paragraph, you can create code span by wrapping text in
266 | backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
267 | `>`) will automatically be translated into HTML entities. This makes
268 | it easy to use Markdown to write about HTML example code:
269 |
270 | I strongly recommend against using any `