4 |
5 | * In a list?
6 | *
7 | * It should.
8 |
9 | > Blockquoted:
10 |
11 | Auto-links should not occur here: ``
12 |
13 | or here:
--------------------------------------------------------------------------------
/test/spec/syntax/autolinks.xhtml:
--------------------------------------------------------------------------------
1 | http://example.com/
2 |
3 | address@exa
6 | mple.com
--------------------------------------------------------------------------------
/test/spec/syntax/lists-1.md:
--------------------------------------------------------------------------------
1 | * Red
2 | * Green
3 | * Blue
4 |
5 | + Red
6 | + Green
7 | + Blue
8 |
9 | - Red
10 | - Green
11 | - Blue
12 |
13 | 1. Bird
14 | 2. McHale
15 | 3. Parish
16 |
17 | 1. Bird
18 | 1. McHale
19 | 1. Parish
20 |
21 | 3. Bird
22 | 1. McHale
23 | 8. Parish
24 |
25 | * Bird
26 | * Magic
27 |
28 | * Bird
29 |
30 | * Magic
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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/mdtest1.1/PHP Markdown.mdtest/Ins & del.text:
--------------------------------------------------------------------------------
1 | Here is a block tag ins:
2 |
3 |
4 | Some text
5 |
6 |
7 | And here it is inside a paragraph.
8 |
9 | And here it is in the middle of a paragraph.
10 |
11 |
12 | Some text
13 |
14 |
15 | And here is ins as a paragraph.
16 |
17 | And here it is in the middle of a paragraph.
18 |
--------------------------------------------------------------------------------
/test/spec/syntax/code.xhtml:
--------------------------------------------------------------------------------
1 | This is a normal paragraph:
2 |
3 | This is a code block.
4 |
5 |
6 | Here is an example of AppleScript:
7 |
8 | tell application "Foo"
9 | beep
10 | end tell
11 |
12 |
13 | Test Foo:
14 |
15 | <div class="footer">
16 | © 2004 Foo Corporation
17 | </div>
18 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Horizontal Rules.xhtml:
--------------------------------------------------------------------------------
1 | Horizontal rules:
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Not horizontal rules (testing for a bug in 1.0.1j):
14 |
15 | +++
16 |
17 | ,,,
18 |
19 | ===
20 |
21 | ???
22 |
23 | AAA
24 |
25 | jjj
26 |
27 | j j j
28 |
29 | n n n
30 |
31 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Code Blocks.xhtml:
--------------------------------------------------------------------------------
1 | code block on the first line
2 |
3 |
4 | Regular text.
5 |
6 | code block indented by spaces
7 |
8 |
9 | Regular text.
10 |
11 | the lines in this block
12 | all contain trailing spaces
13 |
14 |
15 | Regular Text.
16 |
17 | code block on the last line
18 |
19 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Code block in a list item.xhtml:
--------------------------------------------------------------------------------
1 |
2 | List Item:
3 |
4 | code block
5 |
6 | with a blank line
7 |
8 |
9 | within a list item.
10 | code block
11 | as first element of a list item
12 |
13 |
14 | List Item:
15 |
16 | code block with whitespace on preceding line
17 |
18 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Tabs.text:
--------------------------------------------------------------------------------
1 | + this is a list item
2 | indented with tabs
3 |
4 | + this is a list item
5 | indented with spaces
6 |
7 | Code:
8 |
9 | this code block is indented by one tab
10 |
11 | And:
12 |
13 | this code block is indented by two tabs
14 |
15 | And:
16 |
17 | + this is an example list item
18 | indented with tabs
19 |
20 | + this is an example list item
21 | indented with spaces
22 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Tight blocks.xhtml:
--------------------------------------------------------------------------------
1 | Paragraph and no space:
2 | * ciao
3 |
4 | Paragraph and 1 space:
5 | * ciao
6 |
7 | Paragraph and 3 spaces:
8 | * ciao
9 |
10 | Paragraph and 4 spaces:
11 | * ciao
12 |
13 | Paragraph before header:
14 |
15 | Header
16 |
17 | Paragraph before blockquote:
18 |
19 |
20 | Some quote.
21 |
22 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Ins & del.xhtml:
--------------------------------------------------------------------------------
1 | Here is a block tag ins:
2 |
3 |
4 | Some text
5 |
6 |
7 | And here it is inside a paragraph.
8 |
9 | And here it is in the middle of a paragraph.
10 |
11 |
12 | Some text
13 |
14 |
15 | And here is ins as a paragraph.
16 |
17 | And here it is in the middle of a paragraph.
18 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Parens in URL.text:
--------------------------------------------------------------------------------
1 | [Inline link 1 with parens](/url\(test\) "title").
2 |
3 | [Inline link 2 with parens]( "title").
4 |
5 | [Inline link 3 with non-escaped parens](/url(test) "title").
6 |
7 | [Inline link 4 with non-escaped parens]( "title").
8 |
9 | [Reference link 1 with parens][1].
10 |
11 | [Reference link 2 with parens][2].
12 |
13 | [1]: /url(test) "title"
14 | [2]: "title"
15 |
--------------------------------------------------------------------------------
/test/spec/syntax/code-inline.xhtml:
--------------------------------------------------------------------------------
1 | Use the printf() function.
2 |
3 | There is a literal backtick (`) here.
4 |
5 | A single backtick in a code span: `
6 |
7 | A backtick-delimited string in a code span: `foo`
8 |
9 | Please don't use any <blink> tags.
10 |
11 | — is the decimal-encoded
12 | equivalent of —.
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Empty List Item.text:
--------------------------------------------------------------------------------
1 | With asterisks
2 |
3 | * List item
4 | *
5 | * List item
6 |
7 | With numbers
8 |
9 | 1. List item
10 | 2.
11 | 3. List item
12 |
13 | With hyphens
14 |
15 | - List item
16 | -
17 | - List item
18 |
19 | With asterisks
20 |
21 | * List item
22 | * List item
23 | *
24 |
25 | With numbers
26 |
27 | 1. List item
28 | 2. List item
29 | 3.
30 |
31 | With hyphens
32 |
33 | - List item
34 | - List item
35 | -
36 |
--------------------------------------------------------------------------------
/test/spec/basics/headers.md:
--------------------------------------------------------------------------------
1 | A First Level Header
2 | ====================
3 |
4 | A Second Level Header
5 | ---------------------
6 |
7 | Now is the time for all good men to come to
8 | the aid of their country. This is just a
9 | regular paragraph.
10 |
11 | The quick brown fox jumped over the lazy
12 | dog's back.
13 |
14 | ### Header 3
15 |
16 | > This is a blockquote.
17 | >
18 | > This is the second paragraph in the blockquote.
19 | >
20 | > ## This is an H2 in a blockquote
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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 |
17 | And with attributes:
18 |
19 |
23 |
24 | This was broken in 1.0.2b7:
25 |
26 |
31 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Amps and angle encoding.text:
--------------------------------------------------------------------------------
1 | AT&T has an ampersand in their name.
2 |
3 | AT&T is another way to write it.
4 |
5 | This & that.
6 |
7 | 4 < 5.
8 |
9 | 6 > 5.
10 |
11 | Here's a [link] [1] with an ampersand in the URL.
12 |
13 | Here's a link with an amersand in the link text: [AT&T] [2].
14 |
15 | Here's an inline [link](/script?foo=1&bar=2).
16 |
17 | Here's an inline [link]().
18 |
19 |
20 | [1]: http://example.com/?foo=1&bar=2
21 | [2]: http://att.com/ "AT&T"
--------------------------------------------------------------------------------
/test/spec/basics/headers.xhtml:
--------------------------------------------------------------------------------
1 | A First Level Header
2 |
3 | A Second Level Header
4 |
5 | Now is the time for all good men to come to
6 | the aid of their country. This is just a
7 | regular paragraph.
8 |
9 | The quick brown fox jumped over the lazy
10 | dog's back.
11 |
12 | Header 3
13 |
14 |
15 | This is a blockquote.
16 |
17 | This is the second paragraph in the blockquote.
18 |
19 | This is an H2 in a blockquote
20 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Inline HTML (Advanced).xhtml:
--------------------------------------------------------------------------------
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 |
17 | And with attributes:
18 |
19 |
23 |
24 | This was broken in 1.0.2b7:
25 |
26 |
31 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Headers.xhtml:
--------------------------------------------------------------------------------
1 | Header
2 |
3 | Header
4 |
5 | Header
6 |
7 |
8 |
9 | Header
10 |
11 | Paragraph
12 |
13 | Header
14 |
15 | Paragraph
16 |
17 | Header
18 |
19 | Paragraph
20 |
21 |
22 |
23 | Paragraph
24 |
25 | Header
26 |
27 | Paragraph
28 |
29 | Paragraph
30 |
31 | Header
32 |
33 | Paragraph
34 |
35 | Paragraph
36 |
37 | Header
38 |
39 | Paragraph
40 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Parens in URL.xhtml:
--------------------------------------------------------------------------------
1 | Inline link 1 with parens.
2 |
3 | Inline link 2 with parens.
4 |
5 | Inline link 3 with non-escaped parens.
6 |
7 | Inline link 4 with non-escaped parens.
8 |
9 | Reference link 1 with parens.
10 |
11 | Reference link 2 with parens.
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Images.text:
--------------------------------------------------------------------------------
1 | 
2 |
3 | 
4 |
5 | Inline within a paragraph: [alt text](/url/).
6 |
7 | 
8 |
9 | 
10 |
11 | ![alt text]()
12 |
13 | .
14 |
15 | ![Empty]()
16 |
17 | .jpg)
18 |
19 |
20 | ![alt text][foo]
21 |
22 | [foo]: /url/
23 |
24 | ![alt text][bar]
25 |
26 | [bar]: /url/ "Title here"
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Tabs.xhtml:
--------------------------------------------------------------------------------
1 |
7 |
8 | Code:
9 |
10 | this code block is indented by one tab
11 |
12 |
13 | And:
14 |
15 | this code block is indented by two tabs
16 |
17 |
18 | And:
19 |
20 | + this is an example list item
21 | indented with tabs
22 |
23 | + this is an example list item
24 | indented with spaces
25 |
26 |
--------------------------------------------------------------------------------
/test/manual/from-gotchas-plain.md:
--------------------------------------------------------------------------------
1 | ##Header##
2 |
3 | ----------
4 |
5 | Some **bold** Some *italic* and [a link][1]
6 |
7 | A little code sample
8 |
9 |
10 | Web Page Title
11 |
12 |
13 | A picture
14 |
15 | ![alt text][2]
16 |
17 | A list
18 |
19 | - apples
20 | - oranges
21 | - eggs
22 |
23 | A numbered list
24 |
25 | 1. a
26 | 2. b
27 | 3. c
28 |
29 | A little quote
30 |
31 | > It is now time for all good men to come to the aid of their country.
32 |
33 | A final paragraph.
34 |
35 | [1]: http://www.google.com
36 | [2]: http://www.google.com/intl/en_ALL/images/logo.gif
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Amps and angle encoding.xhtml:
--------------------------------------------------------------------------------
1 | AT&T has an ampersand in their name.
2 |
3 | AT&T is another way to write it.
4 |
5 | This & that.
6 |
7 | 4 < 5.
8 |
9 | 6 > 5.
10 |
11 | Here's a link with an ampersand in the URL.
12 |
13 | Here's a link with an amersand in the link text: AT&T.
14 |
15 | Here's an inline link.
16 |
17 | Here's an inline link.
18 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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/manual/bom.md:
--------------------------------------------------------------------------------
1 |
2 | _text_ähere_ asd
3 |
4 | ## Some _ätextö_ here. 出典: *フリー* 百科事典
5 | ---------------------------------
6 |
7 | * 科事 __典 ad
8 | asdd asd__ 科事典
9 | * 科事典
10 | * _files•••ystem path_ under which the app files will be put
11 | * Indented _first_ sub
12 | * Doubleindent **1.1** _with
13 | some wrapping_ highlights and [a link]
14 | (http://url.com "Title here") to boot!
15 | * Indented _second_ sub
16 | * Doubleindent **2.1**
17 | * Doubleindent **2.2**
18 | * The `path to` the Apache2 site config **file (that this
19 | task will create) for** this app deployment
20 |
21 |
--------------------------------------------------------------------------------
/test/manual/no_bom.md:
--------------------------------------------------------------------------------
1 |
2 | _text_ähere_ asd
3 |
4 | ## Some _ätextö_ here. 出典: *フリー* 百科事典
5 | ---------------------------------
6 |
7 | * 科事 __典 ad
8 | asdd asd__ 科事典
9 | * 科事典
10 | * _files•••ystem path_ under which the app files will be put
11 | * Indented _first_ sub
12 | * Doubleindent **1.1** _with
13 | some wrapping_ highlights and [a link]
14 | (http://url.com "Title here") to boot!
15 | * Indented _second_ sub
16 | * Doubleindent **2.1**
17 | * Doubleindent **2.2**
18 | * The `path to` the Apache2 site config **file (that this
19 | task will create) for** this app deployment
20 |
21 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Email auto links.xhtml:
--------------------------------------------------------------------------------
1 | michel.fortin@michelf.com
2 |
3 | International domain names: help@tūdaliņ.lv
4 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/PHP-Specific Bugs.text:
--------------------------------------------------------------------------------
1 | This tests for a bug where quotes escaped by PHP when using
2 | `preg_replace` with the `/e` modifier must be correctly unescaped
3 | (hence the `_UnslashQuotes` function found only in PHP Markdown).
4 |
5 |
6 |
7 | Headers below should appear exactly as they are typed (no backslash
8 | added or removed).
9 |
10 | Header "quoted\" again \\""
11 | ===========================
12 |
13 | Header "quoted\" again \\""
14 | ---------------------------
15 |
16 | ### Header "quoted\" again \\"" ###
17 |
18 |
19 |
20 | Test with tabs for `_Detab`:
21 |
22 | Code 'block' with some "tabs" and "quotes"
23 |
--------------------------------------------------------------------------------
/test/spec/syntax/lists-1.xhtml:
--------------------------------------------------------------------------------
1 |
2 | - Red
3 | - Green
4 | - Blue
5 |
6 |
7 |
8 | - Red
9 | - Green
10 | - Blue
11 |
12 |
13 |
14 | - Red
15 | - Green
16 | - Blue
17 |
18 |
19 |
20 | - Bird
21 | - McHale
22 | - Parish
23 |
24 |
25 |
26 | - Bird
27 | - McHale
28 | - Parish
29 |
30 |
31 |
32 | - Bird
33 | - McHale
34 | - Parish
35 |
36 |
37 |
38 | - Bird
39 | - Magic
40 |
41 |
42 |
43 | Bird
44 | Magic
45 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Auto links.xhtml:
--------------------------------------------------------------------------------
1 | Link: http://example.com/.
2 |
3 | With an ampersand: http://example.com/?foo=1&bar=2
4 |
5 |
10 |
11 |
12 | Blockquoted: http://example.com/
13 |
14 |
15 | Auto-links should not occur here: <http://example.com/>
16 |
17 | or here: <http://example.com/>
18 |
19 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/PHP-Specific Bugs.xhtml:
--------------------------------------------------------------------------------
1 | This tests for a bug where quotes escaped by PHP when using
2 | preg_replace with the /e modifier must be correctly unescaped
3 | (hence the _UnslashQuotes function found only in PHP Markdown).
4 |
5 | Headers below should appear exactly as they are typed (no backslash
6 | added or removed).
7 |
8 | Header "quoted\" again \""
9 |
10 | Header "quoted\" again \""
11 |
12 | Header "quoted\" again \""
13 |
14 | Test with tabs for _Detab:
15 |
16 | Code 'block' with some "tabs" and "quotes"
17 |
18 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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 | [URL wrapped in angle brackets]().
12 |
13 | [URL w/ angle brackets + title]( "Here's the title").
14 |
15 | [Empty]().
16 |
17 | [With parens in the URL](http://en.wikipedia.org/wiki/WIMP_(computing))
18 |
19 | (With outer parens and [parens in url](/foo(bar)))
20 |
21 |
22 | [With parens in the URL](/foo(bar) "and a title")
23 |
24 | (With outer parens and [parens in url](/foo(bar) "and a title"))
25 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Empty List Item.xhtml:
--------------------------------------------------------------------------------
1 | With asterisks
2 |
3 |
4 | - List item
5 |
6 | - List item
7 |
8 |
9 | With numbers
10 |
11 |
12 | - List item
13 |
14 | - List item
15 |
16 |
17 | With hyphens
18 |
19 |
20 | - List item
21 |
22 | - List item
23 |
24 |
25 | With asterisks
26 |
27 |
28 | - List item
29 | - List item
30 |
31 |
32 |
33 | With numbers
34 |
35 |
36 | - List item
37 | - List item
38 |
39 |
40 |
41 | With hyphens
42 |
43 |
44 | - List item
45 | - List item
46 |
47 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Images.xhtml:
--------------------------------------------------------------------------------
1 | 
2 |
3 | 
4 |
5 | Inline within a paragraph: alt text.
6 |
7 | 
8 |
9 | 
10 |
11 | 
12 |
13 |
.
14 |
15 | ![Empty]()
16 |
17 | .jpg)
18 |
19 | 
20 |
21 | 
22 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Horizontal rules.xhtml:
--------------------------------------------------------------------------------
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/mdtest1.1/PHP Markdown Extra.mdtest/Abbr.text:
--------------------------------------------------------------------------------
1 | Some text about HTML, SGML and HTML4.
2 |
3 | Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French).
4 |
5 | *[HTML4]: Hyper Text Markup Language version 4
6 | *[HTML]: Hyper Text Markup Language
7 | *[SGML]: Standard Generalized Markup Language
8 | *[U.S.A.]: United States of America
9 | *[É.U.] : États-Unis d'Amérique
10 | *[É.-U. d'A.] : États-Unis d'Amérique
11 |
12 | And here we have a CD, some CDs, and some other CD's.
13 |
14 | *[CD]: Compact Disk
15 |
16 | Let's transfert documents through TCP/IP, using TCP packets.
17 |
18 | *[IP]: Internet Protocol
19 | *[TCP]: Transmission Control Protocol
20 |
21 | ---
22 |
23 | Bienvenue sur [CMS](http://www.bidulecms.com "Bidule CMS").
24 |
25 | *[CMS]: Content Management System
26 |
27 | ---
28 |
29 | ATCCE
30 |
31 | *[ATCCE]: Abbreviation "Testing" Correct 'Character' < Escapes >
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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/mdtest1.1/Markdown.mdtest/Links, inline style.xhtml:
--------------------------------------------------------------------------------
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 | URL wrapped in angle brackets.
12 |
13 | URL w/ angle brackets + title.
14 |
15 | Empty.
16 |
17 | With parens in the URL
18 |
19 | (With outer parens and parens in url)
20 |
21 | With parens in the URL
22 |
23 | (With outer parens and parens in url)
24 |
--------------------------------------------------------------------------------
/test-mdown-parser-with-node.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var PEG = require('pegjs');
3 |
4 | var pegPath = process.cwd() + '/';
5 |
6 | try {
7 | var parser = PEG.buildParser(
8 | fs.readFileSync(pegPath + 'markdown.pegjs', 'utf-8'));
9 | var testContent = fs.readFileSync(pegPath + 'mdown-test/manual/single-list-test.md', 'utf-8');
10 | //var testContent = fs.readFileSync(pegPath + 'mdown-test/progressing.md', 'utf-8');
11 |
12 | //var parser = PEG.buildParser(
13 | // fs.readFileSync(pegPath + 'temp.pegjs', 'utf-8'));
14 | //var testContent = fs.readFileSync(pegPath + 'temp.md', 'utf-8');
15 |
16 | $_parser = parser; // a global variable to use from inside parse process
17 | var result = parser.parse(testContent);
18 | console.log('=====');
19 | console.log('result:',
20 | result.info(1 + 2 + 4
21 | // V_SHOW_DATA(1) | V_NO_STRIP_DATA(2) | V_NO_PAD_TEXT(4)
22 | ));
23 | } catch(e) {
24 | console.log('error',e);
25 | throw e;
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/test/spec/syntax/blockquotes.md:
--------------------------------------------------------------------------------
1 | > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
2 | > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
3 | > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
4 | >
5 | > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
6 | > id sem consectetuer libero luctus adipiscing.
7 |
8 | > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
9 | consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
10 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
11 |
12 | > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
13 | id sem consectetuer libero luctus adipiscing.
14 |
15 | > This is the first level of quoting.
16 | >
17 | > > This is nested blockquote.
18 | >
19 | > Back to the first level.
20 |
21 | > ## This is a header.
22 | >
23 | > 1. This is the first list item.
24 | > 2. This is the second list item.
25 | >
26 | > Here's some example code:
27 | >
28 | > return shell_exec("echo $input | $markdown_script");
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Abbr.xhtml:
--------------------------------------------------------------------------------
1 | Some text about HTML, SGML and HTML4.
2 |
3 | Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French).
4 |
5 | And here we have a CD, some CDs, and some other CD's.
6 |
7 | Let's transfert documents through TCP/IP, using TCP packets.
8 |
9 |
10 |
11 | Bienvenue sur CMS.
12 |
13 |
14 |
15 | ATCCE
16 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Fenced Code Blocks.text:
--------------------------------------------------------------------------------
1 | ~~~
2 | Fenced
3 | ~~~
4 |
5 | Code block starting and ending with empty lines:
6 | ~~~
7 |
8 |
9 | Fenced
10 |
11 |
12 | ~~~
13 |
14 | Indented code block containing fenced code block sample:
15 |
16 | ~~~
17 | Fenced
18 | ~~~
19 |
20 | Fenced code block with indented code block sample:
21 |
22 | ~~~
23 | Some text
24 |
25 | Indented code block sample code
26 | ~~~
27 |
28 | Fenced code block with long markers:
29 |
30 | ~~~~~~~~~~~~~~~~~~
31 | Fenced
32 | ~~~~~~~~~~~~~~~~~~
33 |
34 | Fenced code block with fenced code block markers of different length in it:
35 |
36 | ~~~~
37 | In code block
38 | ~~~
39 | Still in code block
40 | ~~~~~
41 | Still in code block
42 | ~~~~
43 |
44 | Fenced code block with Markdown header and horizontal rule:
45 |
46 | ~~~
47 | #test
48 | ---
49 | ~~~
50 |
51 | Fenced code block with link definitions, footnote definition and
52 | abbreviation definitions:
53 |
54 | ~~~
55 | [example]: http://example.com/
56 |
57 | [^1]: Footnote def
58 |
59 | *[HTML]: HyperText Markup Language
60 | ~~~
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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/mdtest1.1/Markdown.mdtest/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/mdtest1.1/PHP Markdown Extra.mdtest/Fenced Code Blocks.xhtml:
--------------------------------------------------------------------------------
1 | Fenced
2 |
3 |
4 | Code block starting and ending with empty lines:
5 |
6 |
Fenced
7 |
8 |
9 |
10 |
11 | Indented code block containing fenced code block sample:
12 |
13 | ~~~
14 | Fenced
15 | ~~~
16 |
17 |
18 | Fenced code block with indented code block sample:
19 |
20 | Some text
21 |
22 | Indented code block sample code
23 |
24 |
25 | Fenced code block with long markers:
26 |
27 | Fenced
28 |
29 |
30 | Fenced code block with fenced code block markers of different length in it:
31 |
32 | In code block
33 | ~~~
34 | Still in code block
35 | ~~~~~
36 | Still in code block
37 |
38 |
39 | Fenced code block with Markdown header and horizontal rule:
40 |
41 | #test
42 | ---
43 |
44 |
45 | Fenced code block with link definitions, footnote definition and
46 | abbreviation definitions:
47 |
48 | [example]: http://example.com/
49 |
50 | [^1]: Footnote def
51 |
52 | *[HTML]: HyperText Markup Language
53 |
54 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Links, reference style.xhtml:
--------------------------------------------------------------------------------
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/mdtest1.1/PHP Markdown.mdtest/Emphasis.text:
--------------------------------------------------------------------------------
1 | Combined emphasis:
2 |
3 | 1. ***test test***
4 | 2. ___test test___
5 | 3. *test **test***
6 | 4. **test *test***
7 | 5. ***test* test**
8 | 6. ***test** test*
9 | 7. ***test* test**
10 | 8. **test *test***
11 | 9. *test **test***
12 | 10. _test __test___
13 | 11. __test _test___
14 | 12. ___test_ test__
15 | 13. ___test__ test_
16 | 14. ___test_ test__
17 | 15. __test _test___
18 | 16. _test __test___
19 |
20 |
21 | Incorrect nesting:
22 |
23 | 1. *test **test* test**
24 | 2. _test __test_ test__
25 | 3. **test *test** test*
26 | 4. __test _test__ test_
27 | 5. *test *test* test*
28 | 6. _test _test_ test_
29 | 7. **test **test** test**
30 | 8. __test __test__ test__
31 |
32 |
33 |
34 | No emphasis:
35 |
36 | 1. test* test *test
37 | 2. test** test **test
38 | 3. test_ test _test
39 | 4. test__ test __test
40 |
41 |
42 |
43 | Middle-word emphasis (asterisks):
44 |
45 | 1. *a*b
46 | 2. a*b*
47 | 3. a*b*c
48 | 4. **a**b
49 | 5. a**b**
50 | 6. a**b**c
51 |
52 |
53 | Middle-word emphasis (underscore):
54 |
55 | 1. _a_b
56 | 2. a_b_
57 | 3. a_b_c
58 | 4. __a__b
59 | 5. a__b__
60 | 6. a__b__c
61 |
62 | my_precious_file.txt
63 |
64 |
65 | ## Tricky Cases
66 |
67 | E**. **Test** TestTestTest
68 |
69 | E**. **Test** Test Test Test
70 |
71 |
72 | ## Overlong emphasis
73 |
74 | Name: ____________
75 | Organization: ____
76 | Region/Country: __
77 |
78 | _____Cut here_____
79 |
80 | ____Cut here____
81 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Emphasis.text:
--------------------------------------------------------------------------------
1 | Combined emphasis:
2 |
3 | 1. ***test test***
4 | 2. ___test test___
5 | 3. *test **test***
6 | 4. **test *test***
7 | 5. ***test* test**
8 | 6. ***test** test*
9 | 7. ***test* test**
10 | 8. **test *test***
11 | 9. *test **test***
12 | 10. _test __test___
13 | 11. __test _test___
14 | 12. ___test_ test__
15 | 13. ___test__ test_
16 | 14. ___test_ test__
17 | 15. __test _test___
18 | 16. _test __test___
19 |
20 |
21 | Incorrect nesting:
22 |
23 | 1. *test **test* test**
24 | 2. _test __test_ test__
25 | 3. **test *test** test*
26 | 4. __test _test__ test_
27 | 5. *test *test* test*
28 | 6. _test _test_ test_
29 | 7. **test **test** test**
30 | 8. __test __test__ test__
31 |
32 |
33 |
34 | No emphasis:
35 |
36 | 1. test* test *test
37 | 2. test** test **test
38 | 3. test_ test _test
39 | 4. test__ test __test
40 |
41 |
42 |
43 | Middle-word emphasis (asterisks):
44 |
45 | 1. *a*b
46 | 2. a*b*
47 | 3. a*b*c
48 | 4. **a**b
49 | 5. a**b**
50 | 6. a**b**c
51 |
52 |
53 | Middle-word emphasis (underscore):
54 |
55 | 1. _a_b
56 | 2. a_b_
57 | 3. a_b_c
58 | 4. __a__b
59 | 5. a__b__
60 | 6. a__b__c
61 |
62 | my_precious_file.txt
63 |
64 |
65 | ## Tricky Cases
66 |
67 | E**. **Test** TestTestTest
68 |
69 | E**. **Test** Test Test Test
70 |
71 |
72 | ## Overlong emphasis
73 |
74 | Name: ____________
75 | Organization: ____
76 | Region/Country: __
77 |
78 | _____Cut here_____
79 |
80 | ____Cut here____
81 |
--------------------------------------------------------------------------------
/test/spec/syntax/complex-lists.md:
--------------------------------------------------------------------------------
1 | * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
2 | Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
3 | viverra nec, fringilla in, laoreet vitae, risus.
4 | * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
5 | Suspendisse id sem consectetuer libero luctus adipiscing.
6 |
7 | * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
8 | Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
9 | viverra nec, fringilla in, laoreet vitae, risus.
10 | * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
11 | Suspendisse id sem consectetuer libero luctus adipiscing.
12 |
13 | 1. This is a list item with two paragraphs. Lorem ipsum dolor
14 | sit amet, consectetuer adipiscing elit. Aliquam hendrerit
15 | mi posuere lectus.
16 |
17 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet
18 | vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
19 | sit amet velit.
20 |
21 | 2. Suspendisse id sem consectetuer libero luctus adipiscing.
22 |
23 | * This is a list item with two paragraphs.
24 |
25 | This is the second paragraph in the list item. You're
26 | only required to indent the first line. Lorem ipsum dolor
27 | sit amet, consectetuer adipiscing elit.
28 |
29 | * Another item in the same list.
30 |
31 | * A list item with a blockquote:
32 |
33 | > This is a blockquote
34 | > inside a list item.
35 |
36 | * A list item with a code block:
37 |
38 |
39 |
40 | 1986. What a great season.
41 |
42 | 1986\. What a great season.
--------------------------------------------------------------------------------
/test/manual/all-types-links.md:
--------------------------------------------------------------------------------
1 | [before]: https://before.com
2 |
3 | This is a [standard](http://link.com) link. This [is][7] by integer id. [This][this] is by alias. And [aliases] [aliases] can be separated with space.
4 | [And][] this is with auto-generated label. Oh, [and inline with title](http://inline-title.org "Inline-Title") [by][] the [way][].
5 | And yep, [reference with title][15]. Ids can contain [several words][]. [No][]-label link, by the way. [Before][]-link.
6 |
7 | Aah, and  links are the things I almost forgot. Also, a ![ref-link][] to an image. They can be a links, see: ](ht:/img.src "Image title")
8 |
9 | And what about links with no title [](ht:/test)?
10 |
11 | * [Link][] in a bullet
12 |
13 | [7]: http://is.com
14 | [this]: http://this.com
15 | [aliases]: /aliases
16 | [and]: http://and.com
17 | [15]: http://ref-title.org "Ref-Title"
18 | [by]: 'Ref-Title'
19 | [way]: http://ref-title.org (Ref-Title)
20 | [several words]: http://several-words.com
21 | "And a lot of text here"
22 |
23 |
24 | I get 10 times more traffic from [Google][] than from
25 | [Yahoo][] or [MSN][].
26 |
27 | [google]: http://google.com/ "Google"
28 | [yahoo]: http://search.yahoo.com/ "Yahoo Search"
29 | [msn]: http://search.msn.com/ "MSN Search"
30 |
31 |
32 | I get 10 times more traffic from [Google] [1] than from
33 | [Yahoo] [2] or [MSN] [3].
34 |
35 | [1]: http://google.com/ "Google"
36 | [2]: http://search.yahoo.com/ "Yahoo Search"
37 | [3]: http://search.msn.com/ "MSN Search"
38 |
39 |
--------------------------------------------------------------------------------
/test/manual/complex-lists.md:
--------------------------------------------------------------------------------
1 | * list
2 | * at
3 | * start
4 | With
5 | * another
6 | * list
7 | * inside
8 | * shifted one
9 | * 1. Let
10 | 2. Here
11 | 3. Be
12 | 4. Numbers
13 | List continues
14 |
15 | With another paragraph
16 | * more
17 |
18 | ----
19 |
20 | * Some text, multiline text though, Some text, multiline text *though*, Some text, multiline text though, & Some text, | multiline text though
21 | And no-space line
22 |
23 | May be a heading?
24 |
25 | -----
26 |
27 | Yes?
28 |
29 | * Next item
30 | With
31 | Several
32 | Lines
33 |
34 | * Last item
35 |
36 | Hey-hey
37 | * + item
38 | * yes
39 | * here's two levels
40 | * next level
41 | * I suppose
42 | * Yep?
43 | * 1. item
44 | 2. item 2
45 | 3. item 3
46 |
47 | 4. item
48 | * inside
49 | * inside?
50 | * woo
51 | 5. item
52 |
53 | * one item before last
54 |
55 | * last item
56 |
57 | ----
58 |
59 | 1. Ordered list
60 | With several lines,alhtough
61 | 1. An asterix * and *strong* inside
62 | 1. One more item
63 |
64 | 256. Woo
65 | 9. Back
66 |
67 | 12. Hey-hey
68 |
69 | * A bullet-list inside
70 | * Here
71 | * And here
72 |
73 | 13. simple item
74 |
75 | * And
76 | * One
77 | * More
78 | + Bullet
79 | - List
80 | - Yep
81 |
82 | ----
83 |
84 | > ### Header
85 |
86 | > Header
87 | > --------
88 | > Some text
89 | > Multi
90 | Lined
91 | Item
92 |
93 | >> Two-levelled
94 | >>> Three-levelled
95 |
96 | 3. aND ordered here
97 | 4. Yabadabadoo
98 |
99 |
--------------------------------------------------------------------------------
/test/spec/syntax/links.md:
--------------------------------------------------------------------------------
1 | This is [an example](http://example.com/ "Title") inline link.
2 |
3 | [This link](http://example.net/) has no title attribute.
4 |
5 | See my [About](/about/) page for details.
6 |
7 | This is [an example][id] reference-style link.
8 |
9 | This is [an example] [id] reference-style link.
10 |
11 | [id]: http://example.com/ "Optional Title Here"
12 |
13 | [Foo 1][], [Foo 2][] [Foo 3][] [With.Dots & symbs][]
14 |
15 | [foo 1]: http://example.com/ "Optional Title Here"
16 | [foo 2]: http://example.com/ 'Optional Title Here'
17 | [foo 3]: http://example.com/ (Optional Title Here)
18 | [With.Dots & symbs]: "Optional Title Here"
19 |
20 | [recourses hEre][]
21 |
22 | [recourses here]: http://example.com/longish/path/to/resource/here
23 | "Optional Title Here"
24 |
25 | [Yandex][]
26 |
27 | [Yandex]: http://yandex.ru/
28 |
29 | Visit [Daring Fireball][] for more information.
30 |
31 | [Daring Fireball]: http://daringfireball.net/
32 |
33 | I get 10 times more traffic from [Google] [1] than from
34 | [Yahoo] [2] or [MSN] [3].
35 |
36 | [1]: http://google.com/ "Google"
37 | [2]: http://search.yahoo.com/ "Yahoo Search"
38 | [3]: http://search.msn.com/ "MSN Search"
39 |
40 | I get 10 times more traffic from [Google][] than from
41 | [Yahoo][] or [MSN][].
42 |
43 | [google]: http://google.com/ "Google"
44 | [yahoo]: http://search.yahoo.com/ "Yahoo Search"
45 | [msn]: http://search.msn.com/ "MSN Search"
46 |
47 | I get 10 times more traffic from [Google](http://google.com/ "Google")
48 | than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
49 | [MSN](http://search.msn.com/ "MSN Search").
50 |
51 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Footnotes.text:
--------------------------------------------------------------------------------
1 | This is the first paragraph.[^first]
2 |
3 | [^first]: This is the first note.
4 |
5 | * List item one.[^second]
6 | * List item two.[^third]
7 |
8 | [^third]: This is the third note, defined out of order.
9 | [^second]: This is the second note.
10 | [^fourth]: This is the fourth note.
11 |
12 | # Header[^fourth]
13 |
14 | Some paragraph with a footnote[^1], and another[^2].
15 |
16 | [^1]: Content for fifth footnote.
17 | [^2]: Content for sixth footnote spaning on
18 | three lines, with some span-level markup like
19 | _emphasis_, a [link][].
20 |
21 | [link]: http://www.michelf.com/
22 |
23 | Another paragraph with a named footnote[^fn-name].
24 |
25 | [^fn-name]:
26 | Footnote beginning on the line next to the marker.
27 |
28 | This paragraph should not have a footnote marker since
29 | the footnote is undefined.[^3]
30 |
31 | This paragraph should not have a footnote marker since
32 | the footnote has already been used before.[^1]
33 |
34 | This paragraph links to a footnote with plenty of
35 | block-level content.[^block]
36 |
37 | [^block]:
38 | Paragraph.
39 |
40 | * List item
41 |
42 | > Blockquote
43 |
44 | Code block
45 |
46 | This paragraph host the footnote reference within a
47 | footnote test[^reference].
48 |
49 | [^reference]:
50 | This footnote has a footnote of its own.[^nested]
51 |
52 | [^nested]:
53 | This footnote should appear even though as it is refered
54 | from another footnote. But [^reference] should be litteral
55 | since the footnote with that name has already been used.
56 |
57 | - - -
58 |
59 | Testing unusual footnote name[^1$^!"'].
60 |
61 | [^1$^!"']: Haha!
62 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Ordered and unordered lists.text:
--------------------------------------------------------------------------------
1 | ## Unordered
2 |
3 | Asterisks tight:
4 |
5 | * asterisk 1
6 | * asterisk 2
7 | * asterisk 3
8 |
9 |
10 | Asterisks loose:
11 |
12 | * asterisk 1
13 |
14 | * asterisk 2
15 |
16 | * asterisk 3
17 |
18 | * * *
19 |
20 | Pluses tight:
21 |
22 | + Plus 1
23 | + Plus 2
24 | + Plus 3
25 |
26 |
27 | Pluses loose:
28 |
29 | + Plus 1
30 |
31 | + Plus 2
32 |
33 | + Plus 3
34 |
35 | * * *
36 |
37 |
38 | Minuses tight:
39 |
40 | - Minus 1
41 | - Minus 2
42 | - Minus 3
43 |
44 |
45 | Minuses loose:
46 |
47 | - Minus 1
48 |
49 | - Minus 2
50 |
51 | - Minus 3
52 |
53 |
54 | ## Ordered
55 |
56 | Tight:
57 |
58 | 1. First
59 | 2. Second
60 | 3. Third
61 |
62 | and:
63 |
64 | 1. One
65 | 2. Two
66 | 3. Three
67 |
68 |
69 | Loose using tabs:
70 |
71 | 1. First
72 |
73 | 2. Second
74 |
75 | 3. Third
76 |
77 | and using spaces:
78 |
79 | 1. One
80 |
81 | 2. Two
82 |
83 | 3. Three
84 |
85 | Multiple paragraphs:
86 |
87 | 1. Item 1, graf one.
88 |
89 | Item 2. graf two. The quick brown fox jumped over the lazy dog's
90 | back.
91 |
92 | 2. Item 2.
93 |
94 | 3. Item 3.
95 |
96 |
97 |
98 | ## Nested
99 |
100 | * Tab
101 | * Tab
102 | * Tab
103 |
104 | Here's another:
105 |
106 | 1. First
107 | 2. Second:
108 | * Fee
109 | * Fie
110 | * Foe
111 | 3. Third
112 |
113 | Same thing but with paragraphs:
114 |
115 | 1. First
116 |
117 | 2. Second:
118 | * Fee
119 | * Fie
120 | * Foe
121 |
122 | 3. Third
123 |
124 |
125 | This was an error in Markdown 1.0.1:
126 |
127 | * this
128 |
129 | * sub
130 |
131 | that
132 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Backslash escapes.text:
--------------------------------------------------------------------------------
1 | These should all get escaped:
2 |
3 | Backslash: \\
4 |
5 | Backtick: \`
6 |
7 | Asterisk: \*
8 |
9 | Underscore: \_
10 |
11 | Left brace: \{
12 |
13 | Right brace: \}
14 |
15 | Left bracket: \[
16 |
17 | Right bracket: \]
18 |
19 | Left paren: \(
20 |
21 | Right paren: \)
22 |
23 | Greater-than: \>
24 |
25 | Hash: \#
26 |
27 | Period: \.
28 |
29 | Bang: \!
30 |
31 | Plus: \+
32 |
33 | Minus: \-
34 |
35 |
36 |
37 | These should not, because they occur within a code block:
38 |
39 | Backslash: \\
40 |
41 | Backtick: \`
42 |
43 | Asterisk: \*
44 |
45 | Underscore: \_
46 |
47 | Left brace: \{
48 |
49 | Right brace: \}
50 |
51 | Left bracket: \[
52 |
53 | Right bracket: \]
54 |
55 | Left paren: \(
56 |
57 | Right paren: \)
58 |
59 | Greater-than: \>
60 |
61 | Hash: \#
62 |
63 | Period: \.
64 |
65 | Bang: \!
66 |
67 | Plus: \+
68 |
69 | Minus: \-
70 |
71 |
72 | Nor should these, which occur in code spans:
73 |
74 | Backslash: `\\`
75 |
76 | Backtick: `` \` ``
77 |
78 | Asterisk: `\*`
79 |
80 | Underscore: `\_`
81 |
82 | Left brace: `\{`
83 |
84 | Right brace: `\}`
85 |
86 | Left bracket: `\[`
87 |
88 | Right bracket: `\]`
89 |
90 | Left paren: `\(`
91 |
92 | Right paren: `\)`
93 |
94 | Greater-than: `\>`
95 |
96 | Hash: `\#`
97 |
98 | Period: `\.`
99 |
100 | Bang: `\!`
101 |
102 | Plus: `\+`
103 |
104 | Minus: `\-`
105 |
106 |
107 | These should get escaped, even though they're matching pairs for
108 | other Markdown constructs:
109 |
110 | \*asterisks\*
111 |
112 | \_underscores\_
113 |
114 | \`backticks\`
115 |
116 | This is a code span with a literal backslash-backtick sequence: `` \` ``
117 |
118 | This is a tag with unescaped backticks bar.
119 |
120 | This is a tag with backslashes bar.
121 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Emphasis.xhtml:
--------------------------------------------------------------------------------
1 | Combined emphasis:
2 |
3 |
4 | - test test
5 | - test test
6 | - test test
7 | - test test
8 | - test test
9 | - test test
10 | - test test
11 | - test test
12 | - test test
13 | - test test
14 | - test test
15 | - test test
16 | - test test
17 | - test test
18 | - test test
19 | - test test
20 |
21 |
22 | Incorrect nesting:
23 |
24 |
25 | - *test test* test
26 | - _test test_ test
27 | - test *test test*
28 | - test _test test_
29 | - test *test test*
30 | - test _test test_
31 | - test **test test**
32 | - test __test test__
33 |
34 |
35 | No emphasis:
36 |
37 |
38 | - test* test *test
39 | - test** test **test
40 | - test_ test _test
41 | - test__ test __test
42 |
43 |
44 | Middle-word emphasis (asterisks):
45 |
46 |
47 | - ab
48 | - ab
49 | - abc
50 | - ab
51 | - ab
52 | - abc
53 |
54 |
55 | Middle-word emphasis (underscore):
56 |
57 |
58 | - _a_b
59 | - a_b_
60 | - a_b_c
61 | - __a__b
62 | - a__b__
63 | - a__b__c
64 |
65 |
66 | my_precious_file.txt
67 |
68 | Tricky Cases
69 |
70 | E**. Test TestTestTest
71 |
72 | E**. Test Test Test Test
73 |
74 |
75 | Overlong emphasis
76 |
77 | Name: ____________
78 | Organization: ____
79 | Region/Country: __
80 |
81 | _____Cut here_____
82 |
83 | ____Cut here____
84 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Tables.text:
--------------------------------------------------------------------------------
1 | # Simple tables
2 |
3 | Header 1 | Header 2
4 | --------- | ---------
5 | Cell 1 | Cell 2
6 | Cell 3 | Cell 4
7 |
8 | With leading pipes:
9 |
10 | | Header 1 | Header 2
11 | | --------- | ---------
12 | | Cell 1 | Cell 2
13 | | Cell 3 | Cell 4
14 |
15 | With tailing pipes:
16 |
17 | Header 1 | Header 2 |
18 | --------- | --------- |
19 | Cell 1 | Cell 2 |
20 | Cell 3 | Cell 4 |
21 |
22 | With leading and tailing pipes:
23 |
24 | | Header 1 | Header 2 |
25 | | --------- | --------- |
26 | | Cell 1 | Cell 2 |
27 | | Cell 3 | Cell 4 |
28 |
29 | * * *
30 |
31 | # One-column one-row table
32 |
33 | With leading pipes:
34 |
35 | | Header
36 | | -------
37 | | Cell
38 |
39 | With tailing pipes:
40 |
41 | Header |
42 | ------- |
43 | Cell |
44 |
45 | With leading and tailing pipes:
46 |
47 | | Header |
48 | | ------- |
49 | | Cell |
50 |
51 | * * *
52 |
53 | Table alignement:
54 |
55 | | Default | Right | Center | Left |
56 | | --------- |:--------- |:---------:| ---------:|
57 | | Long Cell | Long Cell | Long Cell | Long Cell |
58 | | Cell | Cell | Cell | Cell |
59 |
60 | Table alignement (alternate spacing):
61 |
62 | | Default | Right | Center | Left |
63 | | --------- | :-------- | :-------: | --------: |
64 | | Long Cell | Long Cell | Long Cell | Long Cell |
65 | | Cell | Cell | Cell | Cell |
66 |
67 | * * *
68 |
69 | # Empty cells
70 |
71 | | Header 1 | Header 2 |
72 | | --------- | --------- |
73 | | A | B |
74 | | C | |
75 |
76 | Header 1 | Header 2
77 | --------- | ---------
78 | A | B
79 | | D
80 |
81 | * * *
82 |
83 | # Missing tailing pipe
84 |
85 | Header 1 | Header 2
86 | --------- | --------- |
87 | Cell | Cell |
88 | Cell | Cell |
89 |
90 | Header 1 | Header 2 |
91 | --------- | ---------
92 | Cell | Cell |
93 | Cell | Cell |
94 |
95 | Header 1 | Header 2 |
96 | --------- | --------- |
97 | Cell | Cell
98 | Cell | Cell |
99 |
100 | Header 1 | Header 2 |
101 | --------- | --------- |
102 | Cell | Cell |
103 | Cell | Cell
104 |
105 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Inline HTML with Markdown content.text:
--------------------------------------------------------------------------------
1 | # Markdown inside code blocks
2 |
3 |
4 | foo
5 |
6 |
7 |
8 | foo
9 |
10 |
11 |
12 | foo
13 |
14 |
15 |
16 | | test _emphasis_ (span) |
17 |
18 |
19 |
20 | | test _emphasis_ (span) |
21 |
22 |
23 |
24 | | test _emphasis_ (block) |
25 |
26 |
27 | ## More complicated
28 |
29 |
30 | |
31 | * this is _not_ a list item |
32 | |
33 | * this is _not_ a list item |
34 | |
35 | * this _is_ a list item
36 | |
37 |
38 |
39 | ## With indent
40 |
41 |
42 |
43 | This text is no code block: if it was, the
44 | closing `
` would be too and the HTML block
45 | would be invalid.
46 |
47 | Markdown content in HTML blocks is assumed to be
48 | indented the same as the block opening tag.
49 |
50 | **This should be the third paragraph after the header.**
51 |
52 |
53 |
54 | ## Code block with rogue `
`s in Markdown code span and block
55 |
56 |
57 |
58 |
59 | This is a code block however:
60 |
61 |
62 |
63 | Funny isn't it? Here is a code span: `
`.
64 |
65 |
66 |
67 |
68 |
69 |
70 | * List item, not a code block
71 |
72 | Some text
73 |
74 | This is a code block.
75 |
76 |
77 |
78 | ## No code block in markdown span mode
79 |
80 |
81 | This is not a code block since Markdown parse paragraph
82 | content as span. Code spans like `
` are allowed though.
83 |
84 |
85 | _Hello_ _world_
86 |
87 | ## Preserving attributes and tags on more than one line:
88 |
89 |
91 | Some _span_ content.
92 |
93 |
94 |
95 | ## Header confusion bug
96 |
97 |
98 |
99 | | Hello World!
100 | ============
101 |
102 | Hello World! |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown.mdtest/Emphasis.xhtml:
--------------------------------------------------------------------------------
1 | Combined emphasis:
2 |
3 |
4 | - test test
5 | - test test
6 | - test test
7 | - test test
8 | - test test
9 | - test test
10 | - test test
11 | - test test
12 | - test test
13 | - test test
14 | - test test
15 | - test test
16 | - test test
17 | - test test
18 | - test test
19 | - test test
20 |
21 |
22 | Incorrect nesting:
23 |
24 |
25 | - *test test* test
26 | - _test test_ test
27 | - test *test test*
28 | - test _test test_
29 | - test *test test*
30 | - test _test test_
31 | - test **test test**
32 | - test __test test__
33 |
34 |
35 | No emphasis:
36 |
37 |
38 | - test* test *test
39 | - test** test **test
40 | - test_ test _test
41 | - test__ test __test
42 |
43 |
44 | Middle-word emphasis (asterisks):
45 |
46 |
47 | - ab
48 | - ab
49 | - abc
50 | - ab
51 | - ab
52 | - abc
53 |
54 |
55 | Middle-word emphasis (underscore):
56 |
57 |
58 | - ab
59 | - ab
60 | - abc
61 | - ab
62 | - ab
63 | - abc
64 |
65 |
66 | mypreciousfile.txt
67 |
68 | Tricky Cases
69 |
70 | E**. Test TestTestTest
71 |
72 | E**. Test Test Test Test
73 |
74 |
75 | Overlong emphasis
76 |
77 | Name: ____________
78 | Organization: ____
79 | Region/Country: __
80 |
81 | _____Cut here_____
82 |
83 | ____Cut here____
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Backslash escapes.xhtml:
--------------------------------------------------------------------------------
1 | These should all get escaped:
2 |
3 | Backslash: \
4 |
5 | Backtick: `
6 |
7 | Asterisk: *
8 |
9 | Underscore: _
10 |
11 | Left brace: {
12 |
13 | Right brace: }
14 |
15 | Left bracket: [
16 |
17 | Right bracket: ]
18 |
19 | Left paren: (
20 |
21 | Right paren: )
22 |
23 | Greater-than: >
24 |
25 | Hash: #
26 |
27 | Period: .
28 |
29 | Bang: !
30 |
31 | Plus: +
32 |
33 | Minus: -
34 |
35 | These should not, because they occur within a code block:
36 |
37 | Backslash: \\
38 |
39 | Backtick: \`
40 |
41 | Asterisk: \*
42 |
43 | Underscore: \_
44 |
45 | Left brace: \{
46 |
47 | Right brace: \}
48 |
49 | Left bracket: \[
50 |
51 | Right bracket: \]
52 |
53 | Left paren: \(
54 |
55 | Right paren: \)
56 |
57 | Greater-than: \>
58 |
59 | Hash: \#
60 |
61 | Period: \.
62 |
63 | Bang: \!
64 |
65 | Plus: \+
66 |
67 | Minus: \-
68 |
69 |
70 | Nor should these, which occur in code spans:
71 |
72 | Backslash: \\
73 |
74 | Backtick: \`
75 |
76 | Asterisk: \*
77 |
78 | Underscore: \_
79 |
80 | Left brace: \{
81 |
82 | Right brace: \}
83 |
84 | Left bracket: \[
85 |
86 | Right bracket: \]
87 |
88 | Left paren: \(
89 |
90 | Right paren: \)
91 |
92 | Greater-than: \>
93 |
94 | Hash: \#
95 |
96 | Period: \.
97 |
98 | Bang: \!
99 |
100 | Plus: \+
101 |
102 | Minus: \-
103 |
104 |
105 | These should get escaped, even though they're matching pairs for
106 | other Markdown constructs:
107 |
108 | *asterisks*
109 |
110 | _underscores_
111 |
112 | `backticks`
113 |
114 | This is a code span with a literal backslash-backtick sequence: \`
115 |
116 | This is a tag with unescaped backticks bar.
117 |
118 | This is a tag with backslashes bar.
119 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Definition Lists.text:
--------------------------------------------------------------------------------
1 | A simple definition list:
2 |
3 | Term 1
4 | : Definition 1
5 |
6 | Term 2
7 | : Definition 2
8 |
9 | With multiple terms:
10 |
11 | Term 1
12 | Term 2
13 | : Definition 1
14 |
15 | Term 3
16 | Term 4
17 | : Definition 2
18 |
19 | With multiple definitions:
20 |
21 | Term 1
22 | : Definition 1
23 | : Definition 2
24 |
25 | Term 2
26 | : Definition 3
27 | : Definition 4
28 |
29 | With multiple lines per definition:
30 |
31 | Term 1
32 | : Definition 1 line 1 ...
33 | Definition 1 line 2
34 | : Definition 2 line 1 ...
35 | Definition 2 line 2
36 |
37 | Term 2
38 | : Definition 3 line 2 ...
39 | Definition 3 line 2
40 | : Definition 4 line 2 ...
41 | Definition 4 line 2
42 |
43 | With paragraphs:
44 |
45 | Term 1
46 |
47 | : Definition 1 (paragraph)
48 |
49 | Term 2
50 |
51 | : Definition 2 (paragraph)
52 |
53 | With multiple paragraphs:
54 |
55 | Term 1
56 |
57 | : Definition 1 paragraph 1 line 1 ...
58 | Definition 1 paragraph 1 line 2
59 |
60 | Definition 1 paragraph 2 line 1 ...
61 | Definition 1 paragraph 2 line 2
62 |
63 | Term 2
64 |
65 | : Definition 1 paragraph 1 line 1 ...
66 | Definition 1 paragraph 1 line 2 (lazy)
67 |
68 | Definition 1 paragraph 2 line 1 ...
69 | Definition 1 paragraph 2 line 2 (lazy)
70 |
71 | * * *
72 |
73 | A mix:
74 |
75 | Term 1
76 | Term 2
77 |
78 | : Definition 1 paragraph 1 line 1 ...
79 | Definition 1 paragraph 1 line 2 (lazy)
80 |
81 | Definition 1 paragraph 2 line 1 ...
82 | Definition 1 paragraph 2 line 2
83 |
84 | : Definition 2 paragraph 1 line 1 ...
85 | Definition 2 paragraph 1 line 2 (lazy)
86 |
87 | Term 3
88 | : Definition 3 (no paragraph)
89 | : Definition 4 (no paragraph)
90 | : Definition 5 line 1 ...
91 | Definition 5 line 2 (no paragraph)
92 |
93 | : Definition 6 paragraph 1 line 1 ...
94 | Definition 6 paragraph 1 line 2
95 | : Definition 7 (no paragraph)
96 | : Definition 8 paragraph 1 line 1 (forced paragraph) ...
97 | Definition 8 paragraph 1 line 2
98 |
99 | Definition 8 paragraph 2 line 1
100 |
101 | Term 4
102 | : Definition 9 paragraph 1 line 1 (forced paragraph) ...
103 | Definition 9 paragraph 1 line 2
104 |
105 | Definition 9 paragraph 2 line 1
106 | : Definition 10 (no paragraph)
107 |
108 | * * *
109 |
110 | Special cases:
111 |
112 | Term
113 |
114 | : code block
115 | as first element of a definition
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/Ordered and unordered lists.xhtml:
--------------------------------------------------------------------------------
1 | Unordered
2 |
3 | Asterisks tight:
4 |
5 |
6 | - asterisk 1
7 | - asterisk 2
8 | - asterisk 3
9 |
10 |
11 | Asterisks loose:
12 |
13 |
14 | asterisk 1
15 | asterisk 2
16 | asterisk 3
17 |
18 |
19 |
20 |
21 | Pluses tight:
22 |
23 |
24 | - Plus 1
25 | - Plus 2
26 | - Plus 3
27 |
28 |
29 | Pluses loose:
30 |
31 |
32 | Plus 1
33 | Plus 2
34 | Plus 3
35 |
36 |
37 |
38 |
39 | Minuses tight:
40 |
41 |
42 | - Minus 1
43 | - Minus 2
44 | - Minus 3
45 |
46 |
47 | Minuses loose:
48 |
49 |
50 | Minus 1
51 | Minus 2
52 | Minus 3
53 |
54 |
55 | Ordered
56 |
57 | Tight:
58 |
59 |
60 | - First
61 | - Second
62 | - Third
63 |
64 |
65 | and:
66 |
67 |
68 | - One
69 | - Two
70 | - Three
71 |
72 |
73 | Loose using tabs:
74 |
75 |
76 | First
77 | Second
78 | Third
79 |
80 |
81 | and using spaces:
82 |
83 |
84 | One
85 | Two
86 | Three
87 |
88 |
89 | Multiple paragraphs:
90 |
91 |
92 | Item 1, graf one.
93 |
94 | Item 2. graf two. The quick brown fox jumped over the lazy dog's
95 | back.
96 | Item 2.
97 | Item 3.
98 |
99 |
100 | Nested
101 |
102 |
111 |
112 | Here's another:
113 |
114 |
115 | - First
116 | - Second:
117 |
118 | - Fee
119 | - Fie
120 | - Foe
121 |
122 | - Third
123 |
124 |
125 | Same thing but with paragraphs:
126 |
127 |
128 | First
129 | Second:
130 |
131 |
132 | - Fee
133 | - Fie
134 | - Foe
135 |
136 | Third
137 |
138 |
139 |
140 | This was an error in Markdown 1.0.1:
141 |
142 |
143 | this
144 |
145 |
146 |
147 | that
148 |
149 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Inline HTML with Markdown content.xhtml:
--------------------------------------------------------------------------------
1 | Markdown inside code blocks
2 |
3 |
8 |
9 |
14 |
15 |
20 |
21 |
22 | | test emphasis (span) |
23 |
24 |
25 |
26 | | test emphasis (span) |
27 |
28 |
29 |
30 | |
31 |
32 | test emphasis (block)
33 |
34 | |
35 |
36 |
37 | More complicated
38 |
39 |
40 | |
41 | * this is not a list item |
42 | |
43 | * this is not a list item |
44 |
45 |
46 |
47 | - this is a list item
48 |
49 |
50 | |
51 |
52 |
53 | With indent
54 |
55 |
56 |
57 |
58 |
This text is no code block: if it was, the
59 | closing <div> would be too and the HTML block
60 | would be invalid.
61 |
62 |
Markdown content in HTML blocks is assumed to be
63 | indented the same as the block opening tag.
64 |
65 |
This should be the third paragraph after the header.
66 |
67 |
68 |
69 |
70 | Code block with rogue </div>s in Markdown code span and block
71 |
72 |
73 |
74 |
75 |
This is a code block however:
76 |
77 |
</div>
78 |
79 |
80 |
Funny isn't it? Here is a code span: </div>.
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | - List item, not a code block
90 |
91 |
92 |
Some text
93 |
94 |
This is a code block.
95 |
96 |
97 |
98 |
99 |
100 | No code block in markdown span mode
101 |
102 |
103 | This is not a code block since Markdown parse paragraph
104 | content as span. Code spans like </p> are allowed though.
105 |
106 |
107 | Hello world
108 |
109 | Preserving attributes and tags on more than one line:
110 |
111 |
113 | Some span content.
114 |
115 |
116 | Header confusion bug
117 |
118 |
119 |
120 | | Hello World!
121 | ============
122 |
123 | Hello World! |
124 |
125 |
--------------------------------------------------------------------------------
/test/manual/progressing.md:
--------------------------------------------------------------------------------
1 | 1. List at start
2 |
3 | > With blockquote inside
4 |
5 | One
6 | ======
7 |
8 | #### Four-levelled heading
9 |
10 | Block of code
11 | Must keep indent here {
12 | Woo-woo olo-lo
13 | some = & a + "join"
14 | }
15 |
16 | And it may contain spaces, of course
17 |
18 | ### Three-levelled
19 |
20 | ##### Five-levelled
21 |
22 | Some *another* paragraph
23 | With __two lines__ of text 碐 and some entities >< inside |
24 |
25 | ## Two-levelled
26 |
27 | # And one
28 |
29 | Some **paragraph** of _text_ and some `code a lot { }` inside, yep?
30 |
31 | Woo-Hoo
32 | -------
33 |
34 | djjdjd
35 |
36 | > Here *is* another blockquote
37 | With several lines
38 | > Yes it is
39 |
40 | >> Two-level blockquote
41 |
42 | >>> Three-level blockquote
43 |
44 | A first paragraph inside the blockquote
45 |
46 | A second paragraph inside the blockquote
47 |
48 | ------
49 |
50 | and the Verbatim inside the blockquote
51 | With some lines of code
52 | Yep
53 |
54 | Please keep indent here also
55 |
56 | {
57 | Mooooooo
58 | }
59 |
60 | A second paragraph inside the blockquote
61 |
62 | * A list inside the blockquote
63 | * The second item
64 |
65 | Paragraph
66 |
67 | And verbatim inside
68 |
69 | > Continues here
70 |
71 | 1. A list
72 | 2. A list with verbatim
73 | Long paragraph
74 |
75 | Second paragraph with several
76 | lines
77 |
78 | Third paragraph with both
79 | lines indented
80 |
81 | Some verbatim {
82 | return wooo;
83 | boo;
84 | }
85 |
86 | And **one** paragraph in the end
87 |
88 | 3. List continues
89 |
90 | OHOHO
91 |
92 | dkdjdjdwooo
WOOHOO
93 |
94 |
95 |
96 | 1. Ordered list
97 | With several lines,alhtough
98 | Line with 5 spaces at left
99 | Line with 4 spaces at left
100 | Line with 0 spaces at left
101 |
102 | And this is second paragraph of first item
103 |
104 | 1. An asterix * and *strong* inside
105 | 1. One more item
106 |
107 | 256. Woo
108 | 9. Back
109 |
110 | 12. Hey-hey
111 |
112 | * A bullet-list inside
113 | * Here
114 | * And here
115 |
116 | 13. simple item
117 |
118 | * And
119 | * One
120 | * More
121 | + Bullet
122 | - List
123 | - Yep
124 |
125 | > ### Header
126 |
127 | > Header
128 | --------
129 | Some text
130 |
131 | > More...
132 |
133 | 3. aND ordered here
134 | 4. Yabadabadoo
135 |
136 | Heading with paragraph below
137 | ===========
138 | akksksk
139 |
140 | Heading with no paragraph below
141 | ===========
142 |
143 |
--------------------------------------------------------------------------------
/Jakefile:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var util = require('util');
3 | var PEG = require('pegjs');
4 |
5 | // CONSTANTS
6 |
7 | var SRC_DIR = ".";
8 | var TEST_DIR = "./test";
9 | var LIB_DIR = "./lib";
10 |
11 | var PEGJS_REQ = 'pegjs';
12 | var PARSER_DEFS_FILE = SRC_DIR + '/parser-defs.js';
13 | var PARSER_SRC_FILE = SRC_DIR + '/markdown.pegjs';
14 | var PARSER_OUT_FILE = LIB_DIR + '/markdown.parser.js';
15 |
16 | /*var TESTS = {
17 | 'man': { 'dir': 'manual',
18 | 'in-ext': 'md',
19 | 'check-ext': 'xhtml' },
20 | 'md-base': { 'dir': 'mdtest1.1/Markdown.mdtest',
21 | 'in-ext': 'text',
22 | 'check-ext': 'x?html' },
23 | 'md-php': { 'dir': 'mdtest1.1/PHP Markdown.mdtest',
24 | 'in-ext': 'text',
25 | 'check-ext': 'x?html' },
26 | 'md-php-ex': { 'dir': 'mdtest1.1/PHP Markdown Extra.mdtest',
27 | 'in-ext': 'text',
28 | 'check-ext': 'x?html' },
29 | 'spec-bsc': { 'dir': 'spec/basics',
30 | 'in-ext': 'md',
31 | 'check-ext': 'xhtml' },
32 | 'spec-stx': { 'dir': 'spec/syntax',
33 | 'in-ext': 'md',
34 | 'check-ext': 'xhtml' }
35 | }*/
36 |
37 | // ======== UTILS
38 |
39 | function abort(message) {
40 | util.error(message);
41 | exitFailure();
42 | }
43 |
44 | function removeDir(dir) {
45 | fs.readdirSync(dir).every(function(file) {
46 | var file = dir + "/" + file;
47 |
48 | var stats = fs.statSync(file);
49 | if (stats.isDirectory()) {
50 | removeDir(file);
51 | } else {
52 | fs.unlinkSync(file);
53 | }
54 |
55 | return true;
56 | });
57 |
58 | fs.rmdirSync(dir);
59 | }
60 |
61 | function dirExists(dir) {
62 | try {
63 | var stats = fs.statSync(file);
64 | } catch (e) {
65 | return false;
66 | }
67 |
68 | return stats.isDirectory();
69 | }
70 |
71 | function mkdirUnlessExists(dir) {
72 | try {
73 | fs.statSync(dir);
74 | } catch (e) {
75 | fs.mkdirSync(dir, 0755);
76 | }
77 | }
78 |
79 | // ======== TASKS
80 |
81 | desc('Remove previously built versions');
82 | task('clean', [], function() {
83 | console.log('[Cleaning]: ' + LIB_DIR);
84 |
85 | if (dirExists(LIB_DIR)) {
86 | removeDir(LIB_DIR);
87 | }
88 | });
89 |
90 | desc('Generate the Markdown parser');
91 | task('build', [], function() {
92 |
93 | console.log('[Building]: ' + PARSER_SRC_FILE + ' -> ...');
94 |
95 | var input = fs.readFileSync(PARSER_SRC_FILE, 'utf8');
96 |
97 | try {
98 | var parser = PEG.buildParser(input);
99 | } catch (e) {
100 | if (e.line !== undefined && e.column !== undefined) {
101 | abort(e.line + ":" + e.column + ": " + e.message);
102 | } else {
103 | abort(e.message);
104 | }
105 | }
106 |
107 | mkdirUnlessExists(LIB_DIR);
108 | fs.writeFileSync(PARSER_OUT_FILE, "PEG.parser = " + parser.toSource() + ";\n");
109 |
110 | console.log('[Built]: -> ' + PARSER_OUT_FILE);
111 |
112 | });
113 |
114 | desc('Test');
115 | task('test', [], function() {
116 | console.log(util.inspect(Array.prototype.slice.call(arguments)));
117 | });
118 |
119 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Definition Lists.xhtml:
--------------------------------------------------------------------------------
1 | A simple definition list:
2 |
3 |
4 | - Term 1
5 | - Definition 1
6 |
7 | - Term 2
8 | - Definition 2
9 |
10 |
11 | With multiple terms:
12 |
13 |
14 | - Term 1
15 | - Term 2
16 | - Definition 1
17 |
18 | - Term 3
19 | - Term 4
20 | - Definition 2
21 |
22 |
23 | With multiple definitions:
24 |
25 |
26 | - Term 1
27 | - Definition 1
28 |
29 | - Definition 2
30 |
31 | - Term 2
32 | - Definition 3
33 |
34 | - Definition 4
35 |
36 |
37 | With multiple lines per definition:
38 |
39 |
40 | - Term 1
41 | - Definition 1 line 1 ...
42 | Definition 1 line 2
43 |
44 | - Definition 2 line 1 ...
45 | Definition 2 line 2
46 |
47 | - Term 2
48 | - Definition 3 line 2 ...
49 | Definition 3 line 2
50 |
51 | - Definition 4 line 2 ...
52 | Definition 4 line 2
53 |
54 |
55 | With paragraphs:
56 |
57 |
58 | - Term 1
59 | -
60 |
Definition 1 (paragraph)
61 |
62 |
63 | - Term 2
64 | -
65 |
Definition 2 (paragraph)
66 |
67 |
68 |
69 | With multiple paragraphs:
70 |
71 |
72 | - Term 1
73 | -
74 |
Definition 1 paragraph 1 line 1 ...
75 | Definition 1 paragraph 1 line 2
76 |
77 | Definition 1 paragraph 2 line 1 ...
78 | Definition 1 paragraph 2 line 2
79 |
80 |
81 | - Term 2
82 | -
83 |
Definition 1 paragraph 1 line 1 ...
84 | Definition 1 paragraph 1 line 2 (lazy)
85 |
86 | Definition 1 paragraph 2 line 1 ...
87 | Definition 1 paragraph 2 line 2 (lazy)
88 |
89 |
90 |
91 |
92 |
93 | A mix:
94 |
95 |
96 | - Term 1
97 | - Term 2
98 | -
99 |
Definition 1 paragraph 1 line 1 ...
100 | Definition 1 paragraph 1 line 2 (lazy)
101 |
102 | Definition 1 paragraph 2 line 1 ...
103 | Definition 1 paragraph 2 line 2
104 |
105 |
106 | -
107 |
Definition 2 paragraph 1 line 1 ...
108 | Definition 2 paragraph 1 line 2 (lazy)
109 |
110 |
111 | - Term 3
112 | - Definition 3 (no paragraph)
113 |
114 | - Definition 4 (no paragraph)
115 |
116 | - Definition 5 line 1 ...
117 | Definition 5 line 2 (no paragraph)
118 |
119 | -
120 |
Definition 6 paragraph 1 line 1 ...
121 | Definition 6 paragraph 1 line 2
122 |
123 |
124 | - Definition 7 (no paragraph)
125 |
126 | -
127 |
Definition 8 paragraph 1 line 1 (forced paragraph) ...
128 | Definition 8 paragraph 1 line 2
129 |
130 | Definition 8 paragraph 2 line 1
131 |
132 |
133 | - Term 4
134 | -
135 |
Definition 9 paragraph 1 line 1 (forced paragraph) ...
136 | Definition 9 paragraph 1 line 2
137 |
138 | Definition 9 paragraph 2 line 1
139 |
140 |
141 | - Definition 10 (no paragraph)
142 |
143 |
144 |
145 |
146 | Special cases:
147 |
148 |
149 | - Term
150 | -
151 |
code block
152 | as first element of a definition
153 |
154 |
155 |
156 |
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Footnotes.xhtml:
--------------------------------------------------------------------------------
1 | This is the first paragraph.1
2 |
3 |
4 | - List item one.2
5 | - List item two.3
6 |
7 |
8 | Header4
9 |
10 | Some paragraph with a footnote5, and another6.
11 |
12 | Another paragraph with a named footnote7.
13 |
14 | This paragraph should not have a footnote marker since
15 | the footnote is undefined.[^3]
16 |
17 | This paragraph should not have a footnote marker since
18 | the footnote has already been used before.[^1]
19 |
20 | This paragraph links to a footnote with plenty of
21 | block-level content.8
22 |
23 | This paragraph host the footnote reference within a
24 | footnote test9.
25 |
26 |
27 |
28 | Testing unusual footnote name10.
29 |
30 |
97 |
--------------------------------------------------------------------------------
/test/manual/github-flavored-markdown.md:
--------------------------------------------------------------------------------
1 | GitHub Flavored Markdown
2 | ================================
3 |
4 | *View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).*
5 |
6 | Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
7 |
8 | Roses are red
9 | Violets are blue
10 |
11 | The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:
12 |
13 | Roses are red
14 | Violets are blue
15 |
16 | Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.
17 |
18 | A bit of the GitHub spice
19 | -------------------------
20 |
21 | In addition to the changes in the previous section, certain references are auto-linked:
22 |
23 | * SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
24 | * User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
25 | * User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
26 | * \#Num: #1
27 | * User/#Num: mojombo#1
28 | * User/Project#Num: mojombo/god#1
29 |
30 | These are dangerous goodies though, and we need to make sure email addresses don't get mangled:
31 |
32 | My email addy is tom@github.com.
33 |
34 | Math is hard, let's go shopping
35 | -------------------------------
36 |
37 | In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.
38 |
39 | Triangles man! a^2 + b^2 = c^2
40 |
41 | We all like making lists
42 | ------------------------
43 |
44 | The above header should be an H2 tag. Now, for a list of fruits:
45 |
46 | * Red Apples
47 | * Purple Grapes
48 | * Green Kiwifruits
49 |
50 | Let's get crazy:
51 |
52 | 1. This is a list item with two paragraphs. Lorem ipsum dolor
53 | sit amet, consectetuer adipiscing elit. Aliquam hendrerit
54 | mi posuere lectus.
55 |
56 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet
57 | vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
58 | sit amet velit.
59 |
60 | 2. Suspendisse id sem consectetuer libero luctus adipiscing.
61 |
62 | What about some code **in** a list? That's insane, right?
63 |
64 | 1. In Ruby you can map like this:
65 |
66 | ['a', 'b'].map { |x| x.uppercase }
67 |
68 | 2. In Rails, you can do a shortcut:
69 |
70 | ['a', 'b'].map(&:uppercase)
71 |
72 | Some people seem to like definition lists
73 |
74 |
75 | - Lower cost
76 | - The new version of this product costs significantly less than the previous one!
77 | - Easier to use
78 | - We've changed the product so that it's much easier to use!
79 |
80 |
81 | I am a robot
82 | ------------
83 |
84 | Maybe you want to print `robot` to the console 1000 times. Why not?
85 |
86 | def robot_invasion
87 | puts("robot " * 1000)
88 | end
89 |
90 | You see, that was formatted as code because it's been indented by four spaces.
91 |
92 | How about we throw some angle braces and ampersands in there?
93 |
94 |
97 |
98 | Set in stone
99 | ------------
100 |
101 | Preformatted blocks are useful for ASCII art:
102 |
103 |
104 | ,-.
105 | , ,-. ,-.
106 | / \ ( )-( )
107 | \ | ,.>-( )-<
108 | \|,' ( )-( )
109 | Y ___`-' `-'
110 | |/__/ `-'
111 | |
112 | |
113 | | -hrr-
114 | ___|_____________
115 |
116 |
117 | Playing the blame game
118 | ----------------------
119 |
120 | If you need to blame someone, the best way to do so is by quoting them:
121 |
122 | > I, at any rate, am convinced that He does not throw dice.
123 |
124 | Or perhaps someone a little less eloquent:
125 |
126 | > I wish you'd have given me this written question ahead of time so I
127 | > could plan for it... I'm sure something will pop into my head here in
128 | > the midst of this press conference, with all the pressure of trying to
129 | > come up with answer, but it hadn't yet...
130 | >
131 | > I don't want to sound like
132 | > I have made no mistakes. I'm confident I have. I just haven't - you
133 | > just put me under the spot here, and maybe I'm not as quick on my feet
134 | > as I should be in coming up with one.
135 |
136 | Table for two
137 | -------------
138 |
139 |
140 |
141 | | ID | Name | Rank |
142 |
143 |
144 | | 1 | Tom Preston-Werner | Awesome |
145 |
146 |
147 | | 2 | Albert Einstein | Nearly as awesome |
148 |
149 |
150 |
151 | Crazy linking action
152 | --------------------
153 |
154 | I get 10 times more traffic from [Google] [1] than from
155 | [Yahoo] [2] or [MSN] [3].
156 |
157 | [1]: http://google.com/ "Google"
158 | [2]: http://search.yahoo.com/ "Yahoo Search"
159 | [3]: http://search.msn.com/ "MSN Search"
--------------------------------------------------------------------------------
/test/mdtest1.1/PHP Markdown Extra.mdtest/Tables.xhtml:
--------------------------------------------------------------------------------
1 | Simple tables
2 |
3 |
4 |
5 |
6 | | Header 1 |
7 | Header 2 |
8 |
9 |
10 |
11 |
12 | | Cell 1 |
13 | Cell 2 |
14 |
15 |
16 | | Cell 3 |
17 | Cell 4 |
18 |
19 |
20 |
21 |
22 | With leading pipes:
23 |
24 |
25 |
26 |
27 | | Header 1 |
28 | Header 2 |
29 |
30 |
31 |
32 |
33 | | Cell 1 |
34 | Cell 2 |
35 |
36 |
37 | | Cell 3 |
38 | Cell 4 |
39 |
40 |
41 |
42 |
43 | With tailing pipes:
44 |
45 |
46 |
47 |
48 | | Header 1 |
49 | Header 2 |
50 |
51 |
52 |
53 |
54 | | Cell 1 |
55 | Cell 2 |
56 |
57 |
58 | | Cell 3 |
59 | Cell 4 |
60 |
61 |
62 |
63 |
64 | With leading and tailing pipes:
65 |
66 |
67 |
68 |
69 | | Header 1 |
70 | Header 2 |
71 |
72 |
73 |
74 |
75 | | Cell 1 |
76 | Cell 2 |
77 |
78 |
79 | | Cell 3 |
80 | Cell 4 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | One-column one-row table
88 |
89 | With leading pipes:
90 |
91 |
92 |
93 |
94 | | Header |
95 |
96 |
97 |
98 |
99 | | Cell |
100 |
101 |
102 |
103 |
104 | With tailing pipes:
105 |
106 |
107 |
108 |
109 | | Header |
110 |
111 |
112 |
113 |
114 | | Cell |
115 |
116 |
117 |
118 |
119 | With leading and tailing pipes:
120 |
121 |
122 |
123 |
124 | | Header |
125 |
126 |
127 |
128 |
129 | | Cell |
130 |
131 |
132 |
133 |
134 |
135 |
136 | Table alignement:
137 |
138 |
139 |
140 |
141 | | Default |
142 | Right |
143 | Center |
144 | Left |
145 |
146 |
147 |
148 |
149 | | Long Cell |
150 | Long Cell |
151 | Long Cell |
152 | Long Cell |
153 |
154 |
155 | | Cell |
156 | Cell |
157 | Cell |
158 | Cell |
159 |
160 |
161 |
162 |
163 | Table alignement (alternate spacing):
164 |
165 |
166 |
167 |
168 | | Default |
169 | Right |
170 | Center |
171 | Left |
172 |
173 |
174 |
175 |
176 | | Long Cell |
177 | Long Cell |
178 | Long Cell |
179 | Long Cell |
180 |
181 |
182 | | Cell |
183 | Cell |
184 | Cell |
185 | Cell |
186 |
187 |
188 |
189 |
190 |
191 |
192 | Empty cells
193 |
194 |
195 |
196 |
197 | | Header 1 |
198 | Header 2 |
199 |
200 |
201 |
202 |
203 | | A |
204 | B |
205 |
206 |
207 | | C |
208 | |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 | | Header 1 |
217 | Header 2 |
218 |
219 |
220 |
221 |
222 | | A |
223 | B |
224 |
225 |
226 | |
227 | D |
228 |
229 |
230 |
231 |
232 |
233 |
234 | Missing tailing pipe
235 |
236 |
237 |
238 |
239 | | Header 1 |
240 | Header 2 |
241 |
242 |
243 |
244 |
245 | | Cell |
246 | Cell |
247 |
248 |
249 | | Cell |
250 | Cell |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 | | Header 1 |
259 | Header 2 |
260 |
261 |
262 |
263 |
264 | | Cell |
265 | Cell |
266 |
267 |
268 | | Cell |
269 | Cell |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 | | Header 1 |
278 | Header 2 |
279 |
280 |
281 |
282 |
283 | | Cell |
284 | Cell |
285 |
286 |
287 | | Cell |
288 | Cell |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 | | Header 1 |
297 | Header 2 |
298 |
299 |
300 |
301 |
302 | | Cell |
303 | Cell |
304 |
305 |
306 | | Cell |
307 | Cell |
308 |
309 |
310 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Markdown parser with PegJS
2 | ==========================
3 |
4 | A Markdown parser written in JavaScript, generated with PEG grammar. Currently, in progress.
5 |
6 | This is a component of [xtd][xtd-md] project, but I plan to finish developing it separately and then merge the result there. (So, the most part of its development history is located there).
7 |
8 | In fact, it is a translation of [PegC Markdown parser][] to JavaScript. But in the end, there are a lot differences in the sources and result.
9 |
10 | The both C variant and JS (this) variant build a tree of parsed document elements, including their offsets and additional data required for generating some HTML result or hightlighting a syntax in some JavaScript implementation.
11 |
12 | Sources
13 | -------
14 |
15 | * [Markdown][] by [John Gruber][], a great documents' syntax agreement
16 | * [PegJS][] by [David Majda][], a JavaScript parsers generator using PEG-like grammars
17 | * [My Customized PegJS Implementation][] with `chunk` variables inside actions and merged with [PegJS predicate fix][].
18 | * [PegC GUI-oriented Markdown parser][] by [Ali Rantakari][], the place where I've found a parser and copied it and now I am modifying it for JavaScript
19 | * [PegC Markdown parser][] by [John MacFarlane][], the version the previous author adapted to implement his GUI-oriented version and in fact the actual and the main PegC parser (and I am taking parts from there to include new things here)
20 | * [PegC][] by [Stephan Beal][], itself
21 | * [PegHS Markdown parser][], again by [John MacFarlane][], if you are interested
22 | * [Codemirror 2][], the nerdy JS-written any-language source-code editor I plan to integrate with
23 | * [MDTest 1.1][] by [Michel Fortin][]
24 |
25 | The Development State
26 | ---------------------
27 |
28 | Finished
29 |
30 | * Inlines: Strong, Em, Code
31 | * Html Blocks, Html entities
32 | * Headings
33 | * Horizontal Rules
34 | * Paragraphs
35 | * Top-level Lists
36 | * Top-level verbatims
37 | * Links, all modifications
38 | * Images, all modifications
39 | * Oh, all that stuff except complex lists
40 |
41 | Not finished
42 |
43 | (They were working some not ideal way, but I am currently refactoring this part)
44 |
45 | * Nested lists and blocks inside them
46 | * Different extra syntax
47 | * Search over the new stuff in [PegC Markdown parser][] implementation
48 | * Test over for for [Markdown Syntax][]
49 | * Check out [Markdown Gotchas][]
50 | * Test with [MDTest 1.1][] by [Michel Fortin][]
51 | * Support [Markdown Extra][]
52 |
53 | So currently, the *lists* are parsed ok, but I plan to modify their rules to support complex indentations.
54 |
55 | Which Way the Result Looks Like
56 | -------------------------------
57 |
58 | When parsing a MarkDown document, you get a JavaScript Object containing the document tree in Markdown terms. I'll make a detailed description when I'll finish an implementation.
59 |
60 | Competitors
61 | -----------
62 |
63 | Just a JS-ones:
64 |
65 | * [Showdown][] by [Corey Innis][]
66 | * [MarkdownJS][] by [Dominic Baggott][]
67 | * [Pagedown][] used at [StackOverflow][]
68 | * [WMDEditor][] used at [StackOverflow][]
69 |
70 | To Develop
71 | ----------
72 |
73 | Install last [node.js][] version (`v0.5.8+`)
74 |
75 | Install [npm][]
76 |
77 | Run in node directory (or with `-g`):
78 |
79 | npm install pegjs
80 | npm install jake@1.7 # or higher
81 |
82 | cd ~/Worktable # (for example)
83 | git clone git@github.com:shamansir/pegjs.git
84 | cd ./pegjs
85 | jake build
86 | node test/run
87 | ln -sf ~/Worktable/pegjs /lib/node_modules
88 | ln -s /lib/node_modules ./node_modules # optional, if pegjs module not found
89 | cd ~/Workspace # (for example)
90 | git clone git@github.com:shamansir/mdown-parse-pegjs.git
91 | cd ./mdown-parse-pegjs
92 | node ./test-mdown-parser-with-node.js
93 |
94 | [xtd-md]: https://github.com/shamansir/xtd/tree/master/sources/assets/mdown-parse-pegjs
95 |
96 | [Markdown]: http://daringfireball.net/projects/markdown/syntax
97 | [Markdown Syntax]: http://daringfireball.net/projects/markdown/syntax
98 | [Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
99 | [Codemirror 2]: http://codemirror.net/
100 |
101 | [PegC]: http://fossil.wanderinghorse.net/repos/pegc/index.cgi/index
102 | [PegJS]: http://pegjs.majda.cz
103 | [My Customized PegJS Implementation]: https://github.com/shamansir/pegjs
104 | [PegJS predicate fix]: https://github.com/jdarpinian/pegjs
105 |
106 | [PegC Markdown Parser]: https://github.com/jgm/peg-markdown
107 | [PegC GUI-oriented Markdown parser]: http://hasseg.org/peg-markdown-highlight/
108 | [PegHS Markdown Parser]: https://github.com/jgm/markdown-peg
109 |
110 | [John Gruber]: http://daringfireball.net/
111 | [John MacFarlane]: http://johnmacfarlane.net/
112 | [David Majda]: http://majda.cz/en/
113 | [Ali Rantakari]: http://hasseg.org
114 | [Dominic Baggott]: http://www.evilstreak.co.uk/
115 | [Corey Innis]: http://coolerator.net/
116 | [Michel Fortin]: http://michelf.com/
117 | [Stephan Beal]: http://wanderinghorse.net/home/stephan
118 |
119 | [Showdown]: https://github.com/coreyti/showdown
120 | [MarkdownJS]: https://github.com/evilstreak/markdown-js/blob/master/lib/markdown.js
121 | [Pagedown]: http://code.google.com/p/pagedown/
122 | [WMDEditor]: http://code.google.com/p/wmd/
123 | [StackOverflow]: http://stackoverflow.com/
124 |
125 | [node.js]: http://nodejs.org/#download
126 | [npm]: http://npmjs.org/
127 | [MDTest 1.0]: http://six.pairlist.net/pipermail/markdown-discuss/2007-July/000674.html
128 | [MDTest 1.1]: http://git.michelf.com/mdtest/
129 |
--------------------------------------------------------------------------------
/test/manual/links.md:
--------------------------------------------------------------------------------
1 |
2 | [one][1] and [two][2] and [three] [3] and [four][4] and [five][5] and [six][6] and [seven][7] and [eight][8] and [nine][9] and [ten][10].
3 |
4 | [one][11] and [two][12] and [three] [13] and [four][14] and [five][15] and [six][16] and [seven][17] and [eight][18] and [nine][19] and [ten][20].
5 |
6 | [one][21] and [two][22] and [three] [23] and [four][24] and [five][25] and [six][26] and [seven][27] and [eight][28] and [nine][29] and [ten][30].
7 |
8 | [first][a] and [second][b] and [third][c] and [fourth][d] and [fifth][e] and [sixth][f] and [seventh][g] letters.
9 |
10 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere].
11 |
12 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere].
13 |
14 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere].
15 |
16 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere].
17 |
18 | [1]: http://google.com
19 | [2]: http://google.com
20 | [3]: http://google.com
21 | [4]: http://google.com
22 | [5]: http://google.com
23 | [6]: http://google.com
24 | [7]: http://google.com
25 | [8]: http://google.com
26 | [9]: http://google.com
27 | [10]: http://google.com
28 |
29 | [11]: http://google.com
30 | [12]: http://google.com
31 | [13]: http://google.com
32 | [14]: http://google.com
33 | [15]: http://google.com
34 | [16]: http://google.com
35 | [17]: http://google.com
36 | [18]: http://google.com
37 | [19]: http://google.com
38 | [20]: http://google.com
39 |
40 | [21]: http://google.com
41 | [22]: http://google.com
42 | [23]: http://google.com
43 | [24]: http://google.com
44 | [25]: http://google.com
45 | [26]: http://google.com
46 | [27]: http://google.com
47 | [28]: http://google.com
48 | [29]: http://google.com
49 | [30]: http://google.com
50 |
51 | [a]: http://google.com
52 | [b]: http://google.com
53 | [c]: http://google.com
54 | [d]: http://google.com
55 | [e]: http://google.com
56 |
57 |
--------------------------------------------------------------------------------
/test/mdtest1.1/Markdown.mdtest/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 `