kramdown 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kramdown might be problematic. Click here for more details.

Files changed (201) hide show
  1. data/AUTHORS +1 -0
  2. data/COPYING +24 -0
  3. data/ChangeLog +1416 -0
  4. data/GPL +674 -0
  5. data/README +20 -0
  6. data/Rakefile +300 -0
  7. data/VERSION +1 -0
  8. data/benchmark/benchmark.rb +33 -0
  9. data/benchmark/mdbasics.text +306 -0
  10. data/benchmark/mdsyntax.text +888 -0
  11. data/benchmark/testing.sh +9 -0
  12. data/benchmark/timing.sh +10 -0
  13. data/bin/kramdown +26 -0
  14. data/doc/default.css +293 -0
  15. data/doc/default.template +78 -0
  16. data/doc/index.page +89 -0
  17. data/doc/installation.page +90 -0
  18. data/doc/news.feed +10 -0
  19. data/doc/news.page +27 -0
  20. data/doc/quickref.page +474 -0
  21. data/doc/syntax.page +1089 -0
  22. data/doc/tests.page +44 -0
  23. data/doc/virtual +2 -0
  24. data/lib/kramdown.rb +23 -0
  25. data/lib/kramdown/converter.rb +215 -0
  26. data/lib/kramdown/document.rb +150 -0
  27. data/lib/kramdown/error.rb +27 -0
  28. data/lib/kramdown/extension.rb +73 -0
  29. data/lib/kramdown/parser.rb +1056 -0
  30. data/lib/kramdown/parser/registry.rb +62 -0
  31. data/setup.rb +1585 -0
  32. data/test/run_tests.rb +58 -0
  33. data/test/test_files.rb +39 -0
  34. data/test/testcases/block/01_blank_line/spaces.html +1 -0
  35. data/test/testcases/block/01_blank_line/spaces.text +3 -0
  36. data/test/testcases/block/01_blank_line/tabs.html +1 -0
  37. data/test/testcases/block/01_blank_line/tabs.text +6 -0
  38. data/test/testcases/block/02_eob/beginning.html +1 -0
  39. data/test/testcases/block/02_eob/beginning.text +3 -0
  40. data/test/testcases/block/02_eob/end.html +1 -0
  41. data/test/testcases/block/02_eob/end.text +3 -0
  42. data/test/testcases/block/02_eob/middle.html +1 -0
  43. data/test/testcases/block/02_eob/middle.text +5 -0
  44. data/test/testcases/block/03_paragraph/indented.html +18 -0
  45. data/test/testcases/block/03_paragraph/indented.text +19 -0
  46. data/test/testcases/block/03_paragraph/no_newline_at_end.html +5 -0
  47. data/test/testcases/block/03_paragraph/no_newline_at_end.text +5 -0
  48. data/test/testcases/block/03_paragraph/one_para.html +1 -0
  49. data/test/testcases/block/03_paragraph/one_para.text +1 -0
  50. data/test/testcases/block/03_paragraph/two_para.html +4 -0
  51. data/test/testcases/block/03_paragraph/two_para.text +4 -0
  52. data/test/testcases/block/04_header/atx_header.html +26 -0
  53. data/test/testcases/block/04_header/atx_header.text +24 -0
  54. data/test/testcases/block/04_header/atx_header_no_newline_at_end.html +1 -0
  55. data/test/testcases/block/04_header/atx_header_no_newline_at_end.text +1 -0
  56. data/test/testcases/block/04_header/setext_header.html +25 -0
  57. data/test/testcases/block/04_header/setext_header.text +27 -0
  58. data/test/testcases/block/04_header/setext_header_no_newline_at_end.html +1 -0
  59. data/test/testcases/block/04_header/setext_header_no_newline_at_end.text +2 -0
  60. data/test/testcases/block/04_header/with_auto_ids.html +17 -0
  61. data/test/testcases/block/04_header/with_auto_ids.options +1 -0
  62. data/test/testcases/block/04_header/with_auto_ids.text +19 -0
  63. data/test/testcases/block/05_blockquote/indented.html +25 -0
  64. data/test/testcases/block/05_blockquote/indented.text +14 -0
  65. data/test/testcases/block/05_blockquote/nested.html +9 -0
  66. data/test/testcases/block/05_blockquote/nested.text +5 -0
  67. data/test/testcases/block/05_blockquote/no_newline_at_end.html +4 -0
  68. data/test/testcases/block/05_blockquote/no_newline_at_end.text +2 -0
  69. data/test/testcases/block/05_blockquote/only_first_quoted.html +8 -0
  70. data/test/testcases/block/05_blockquote/only_first_quoted.text +4 -0
  71. data/test/testcases/block/05_blockquote/with_code_blocks.html +15 -0
  72. data/test/testcases/block/05_blockquote/with_code_blocks.text +11 -0
  73. data/test/testcases/block/06_codeblock/error.html +4 -0
  74. data/test/testcases/block/06_codeblock/error.text +4 -0
  75. data/test/testcases/block/06_codeblock/no_newline_at_end.html +2 -0
  76. data/test/testcases/block/06_codeblock/no_newline_at_end.text +1 -0
  77. data/test/testcases/block/06_codeblock/normal.html +13 -0
  78. data/test/testcases/block/06_codeblock/normal.text +10 -0
  79. data/test/testcases/block/06_codeblock/tilde_syntax.html +7 -0
  80. data/test/testcases/block/06_codeblock/tilde_syntax.text +9 -0
  81. data/test/testcases/block/06_codeblock/whitespace.html +3 -0
  82. data/test/testcases/block/06_codeblock/whitespace.text +3 -0
  83. data/test/testcases/block/06_codeblock/with_blank_line.html +13 -0
  84. data/test/testcases/block/06_codeblock/with_blank_line.text +11 -0
  85. data/test/testcases/block/06_codeblock/with_eob_marker.html +6 -0
  86. data/test/testcases/block/06_codeblock/with_eob_marker.text +5 -0
  87. data/test/testcases/block/07_horizontal_rule/error.html +7 -0
  88. data/test/testcases/block/07_horizontal_rule/error.text +7 -0
  89. data/test/testcases/block/07_horizontal_rule/normal.html +19 -0
  90. data/test/testcases/block/07_horizontal_rule/normal.text +19 -0
  91. data/test/testcases/block/08_list/escaping.html +17 -0
  92. data/test/testcases/block/08_list/escaping.text +17 -0
  93. data/test/testcases/block/08_list/list_and_hr.html +9 -0
  94. data/test/testcases/block/08_list/list_and_hr.text +5 -0
  95. data/test/testcases/block/08_list/list_and_others.html +38 -0
  96. data/test/testcases/block/08_list/list_and_others.text +25 -0
  97. data/test/testcases/block/08_list/mixed.html +111 -0
  98. data/test/testcases/block/08_list/mixed.text +66 -0
  99. data/test/testcases/block/08_list/nested.html +17 -0
  100. data/test/testcases/block/08_list/nested.text +7 -0
  101. data/test/testcases/block/08_list/other_first_element.html +39 -0
  102. data/test/testcases/block/08_list/other_first_element.text +18 -0
  103. data/test/testcases/block/08_list/simple_ol.html +19 -0
  104. data/test/testcases/block/08_list/simple_ol.text +13 -0
  105. data/test/testcases/block/08_list/simple_ul.html +61 -0
  106. data/test/testcases/block/08_list/simple_ul.text +43 -0
  107. data/test/testcases/block/08_list/single_item.html +3 -0
  108. data/test/testcases/block/08_list/single_item.text +1 -0
  109. data/test/testcases/block/08_list/special_cases.html +29 -0
  110. data/test/testcases/block/08_list/special_cases.text +19 -0
  111. data/test/testcases/block/09_html/auto_parse_block_html.html +17 -0
  112. data/test/testcases/block/09_html/auto_parse_block_html.options +1 -0
  113. data/test/testcases/block/09_html/auto_parse_block_html.text +14 -0
  114. data/test/testcases/block/09_html/comment.html +12 -0
  115. data/test/testcases/block/09_html/comment.text +12 -0
  116. data/test/testcases/block/09_html/filtered_html.html +1 -0
  117. data/test/testcases/block/09_html/filtered_html.options +1 -0
  118. data/test/testcases/block/09_html/filtered_html.text +1 -0
  119. data/test/testcases/block/09_html/html_and_codeblocks.html +15 -0
  120. data/test/testcases/block/09_html/html_and_codeblocks.options +1 -0
  121. data/test/testcases/block/09_html/html_and_codeblocks.text +13 -0
  122. data/test/testcases/block/09_html/invalid_html_1.html +5 -0
  123. data/test/testcases/block/09_html/invalid_html_1.text +5 -0
  124. data/test/testcases/block/09_html/invalid_html_2.html +6 -0
  125. data/test/testcases/block/09_html/invalid_html_2.text +5 -0
  126. data/test/testcases/block/09_html/parse_as_raw.html +26 -0
  127. data/test/testcases/block/09_html/parse_as_raw.text +16 -0
  128. data/test/testcases/block/09_html/parse_as_span.html +12 -0
  129. data/test/testcases/block/09_html/parse_as_span.text +7 -0
  130. data/test/testcases/block/09_html/processing_instruction.html +12 -0
  131. data/test/testcases/block/09_html/processing_instruction.text +12 -0
  132. data/test/testcases/block/09_html/simple.html +78 -0
  133. data/test/testcases/block/09_html/simple.text +56 -0
  134. data/test/testcases/block/10_ald/simple.html +2 -0
  135. data/test/testcases/block/10_ald/simple.text +8 -0
  136. data/test/testcases/block/11_ial/simple.html +17 -0
  137. data/test/testcases/block/11_ial/simple.text +25 -0
  138. data/test/testcases/block/12_extension/comment.html +5 -0
  139. data/test/testcases/block/12_extension/comment.text +11 -0
  140. data/test/testcases/block/12_extension/ignored.html +6 -0
  141. data/test/testcases/block/12_extension/ignored.text +11 -0
  142. data/test/testcases/block/12_extension/kdoptions.html +15 -0
  143. data/test/testcases/block/12_extension/kdoptions.text +18 -0
  144. data/test/testcases/block/12_extension/kdoptions2.html +10 -0
  145. data/test/testcases/block/12_extension/kdoptions2.text +5 -0
  146. data/test/testcases/block/12_extension/nokramdown.html +6 -0
  147. data/test/testcases/block/12_extension/nokramdown.text +11 -0
  148. data/test/testcases/span/01_link/empty.html +3 -0
  149. data/test/testcases/span/01_link/empty.text +3 -0
  150. data/test/testcases/span/01_link/image_in_a.html +5 -0
  151. data/test/testcases/span/01_link/image_in_a.text +5 -0
  152. data/test/testcases/span/01_link/imagelinks.html +12 -0
  153. data/test/testcases/span/01_link/imagelinks.text +14 -0
  154. data/test/testcases/span/01_link/inline.html +40 -0
  155. data/test/testcases/span/01_link/inline.text +42 -0
  156. data/test/testcases/span/01_link/link_defs.html +8 -0
  157. data/test/testcases/span/01_link/link_defs.text +22 -0
  158. data/test/testcases/span/01_link/links_with_angle_brackets.html +3 -0
  159. data/test/testcases/span/01_link/links_with_angle_brackets.text +3 -0
  160. data/test/testcases/span/01_link/reference.html +32 -0
  161. data/test/testcases/span/01_link/reference.text +42 -0
  162. data/test/testcases/span/02_emphasis/empty.html +3 -0
  163. data/test/testcases/span/02_emphasis/empty.text +3 -0
  164. data/test/testcases/span/02_emphasis/errors.html +9 -0
  165. data/test/testcases/span/02_emphasis/errors.text +9 -0
  166. data/test/testcases/span/02_emphasis/nesting.html +34 -0
  167. data/test/testcases/span/02_emphasis/nesting.text +30 -0
  168. data/test/testcases/span/02_emphasis/normal.html +42 -0
  169. data/test/testcases/span/02_emphasis/normal.text +42 -0
  170. data/test/testcases/span/03_codespan/empty.html +5 -0
  171. data/test/testcases/span/03_codespan/empty.text +5 -0
  172. data/test/testcases/span/03_codespan/errors.html +1 -0
  173. data/test/testcases/span/03_codespan/errors.text +1 -0
  174. data/test/testcases/span/03_codespan/normal.html +16 -0
  175. data/test/testcases/span/03_codespan/normal.text +16 -0
  176. data/test/testcases/span/04_footnote/definitions.html +14 -0
  177. data/test/testcases/span/04_footnote/definitions.text +18 -0
  178. data/test/testcases/span/04_footnote/footnote_nr.html +12 -0
  179. data/test/testcases/span/04_footnote/footnote_nr.options +1 -0
  180. data/test/testcases/span/04_footnote/footnote_nr.text +4 -0
  181. data/test/testcases/span/04_footnote/markers.html +46 -0
  182. data/test/testcases/span/04_footnote/markers.text +26 -0
  183. data/test/testcases/span/05_html/normal.html +17 -0
  184. data/test/testcases/span/05_html/normal.text +17 -0
  185. data/test/testcases/span/autolinks/url_links.html +9 -0
  186. data/test/testcases/span/autolinks/url_links.text +9 -0
  187. data/test/testcases/span/escaped_chars/normal.html +33 -0
  188. data/test/testcases/span/escaped_chars/normal.text +33 -0
  189. data/test/testcases/span/ial/simple.html +5 -0
  190. data/test/testcases/span/ial/simple.text +5 -0
  191. data/test/testcases/span/line_breaks/normal.html +11 -0
  192. data/test/testcases/span/line_breaks/normal.text +11 -0
  193. data/test/testcases/span/text_substitutions/entities.html +4 -0
  194. data/test/testcases/span/text_substitutions/entities.text +4 -0
  195. data/test/testcases/span/text_substitutions/greaterthan.html +1 -0
  196. data/test/testcases/span/text_substitutions/greaterthan.text +1 -0
  197. data/test/testcases/span/text_substitutions/lowerthan.html +1 -0
  198. data/test/testcases/span/text_substitutions/lowerthan.text +1 -0
  199. data/test/testcases/span/text_substitutions/typography.html +3 -0
  200. data/test/testcases/span/text_substitutions/typography.text +3 -0
  201. metadata +259 -0
@@ -0,0 +1,66 @@
1
+ With tabs/spaces, no paras:
2
+
3
+ * item1
4
+ + item2
5
+ - item3
6
+
7
+ With tabs/spaces, paras:
8
+
9
+ - item1
10
+
11
+ * item2
12
+
13
+ + item3
14
+
15
+ With tabs/spaces, no paras:
16
+
17
+ 1. item1
18
+ 20. item2
19
+ 3. item3
20
+
21
+ With tabs/spaces, paras:
22
+
23
+ 1. item1
24
+
25
+ 2. item2
26
+
27
+ 3. item3
28
+
29
+ Nested, without paras:
30
+
31
+ * item1
32
+ * item2
33
+ * item3
34
+
35
+ Nested, with paras:
36
+
37
+ + item1
38
+
39
+ * item2
40
+ * item3 (level 3)
41
+
42
+ Ordered, without paras:
43
+
44
+ 1. item1
45
+ 2. item2
46
+ * do
47
+ * it
48
+ * now
49
+ 3. item3
50
+
51
+ Ordered, with paras:
52
+
53
+ 1. item1
54
+
55
+ 2. item2
56
+
57
+ * do
58
+ * it
59
+ * now
60
+
61
+ 3. item3
62
+
63
+ Mixed tabs and spaces:
64
+
65
+ * some text
66
+ * nested
@@ -0,0 +1,17 @@
1
+ <ul>
2
+ <li>some item
3
+ <ul>
4
+ <li>nested</li>
5
+ </ul>
6
+ </li>
7
+ <li>last item</li>
8
+ </ul>
9
+ <ul>
10
+ <li>
11
+ <p>some text</p>
12
+
13
+ <ul>
14
+ <li>nested</li>
15
+ </ul>
16
+ </li>
17
+ </ul>
@@ -0,0 +1,7 @@
1
+ * some item
2
+ * nested
3
+ * last item
4
+ ^
5
+ * some text
6
+
7
+ * nested
@@ -0,0 +1,39 @@
1
+ <ul>
2
+ <li>
3
+ <pre><code>This is a code block.
4
+ </code></pre>
5
+ </li>
6
+ <li>
7
+ <blockquote>
8
+ <p>This is a blockquote.</p>
9
+ </blockquote>
10
+ </li>
11
+ <li>
12
+ <h2>A header</h2>
13
+ </li>
14
+ </ul>
15
+ <ul>
16
+ <li>
17
+ <pre><code>This is a code block.
18
+ </code></pre>
19
+ </li>
20
+ <li>
21
+ <blockquote>
22
+ <p>This is a blockquote.</p>
23
+ </blockquote>
24
+ <p>Followed by some para.</p>
25
+ </li>
26
+ <li>
27
+ <h1>A header</h1>
28
+ <p>a para</p>
29
+ </li>
30
+ </ul>
31
+ <ul>
32
+ <li>
33
+ <ul>
34
+ <li>nested list</li>
35
+ <li>other nested item</li>
36
+ </ul>
37
+ </li>
38
+ <li>item 2</li>
39
+ </ul>
@@ -0,0 +1,18 @@
1
+ *
2
+ This is a code block.
3
+ * > This is a blockquote.
4
+ * ## A header
5
+ ^
6
+ *
7
+ This is a code block.
8
+
9
+ * > This is a blockquote.
10
+ Followed by some para.
11
+
12
+ * A header
13
+ =========
14
+ a para
15
+ ^
16
+ * * nested list
17
+ * other nested item
18
+ * item 2
@@ -0,0 +1,19 @@
1
+ <ol>
2
+ <li>This is a simple list item</li>
3
+ <li>
4
+ <p>Followed by another</p>
5
+ </li>
6
+ <li>
7
+ <p>Followed by</p>
8
+
9
+ <p>a para list item</p>
10
+ </li>
11
+ <li>and a normal one</li>
12
+ <li>
13
+ <p>and</p>
14
+
15
+ <p>a para</p>
16
+ </li>
17
+ </ol>
18
+
19
+ <p>para</p>
@@ -0,0 +1,13 @@
1
+ 1. This is a simple list item
2
+ 3. Followed by another
3
+
4
+
5
+ 10. Followed by
6
+
7
+ a para list item
8
+ 1. and a normal one
9
+ 2. and
10
+
11
+ a para
12
+
13
+ para
@@ -0,0 +1,61 @@
1
+ <ul>
2
+ <li>This is a simple list item</li>
3
+ <li>
4
+ <p>Followed by another</p>
5
+ </li>
6
+ <li>
7
+ <p>Followed by</p>
8
+
9
+ <p>a para list item</p>
10
+ </li>
11
+ <li>and a normal one</li>
12
+ <li>
13
+ <p>and</p>
14
+
15
+ <p>a para</p>
16
+ </li>
17
+ </ul>
18
+
19
+ <p>para</p>
20
+
21
+ <ul>
22
+ <li>multi line
23
+ list item</li>
24
+ </ul>
25
+
26
+ <p>para</p>
27
+
28
+ <ul>
29
+ <li>list item line1
30
+ one line
31
+ two lines</li>
32
+ <li>list item line2
33
+ one line
34
+ two lines</li>
35
+ </ul>
36
+
37
+ <p>para</p>
38
+
39
+ <ul>
40
+ <li>list item line3
41
+ one line
42
+ two lines</li>
43
+ <li>list item line4
44
+ one line
45
+ two lines</li>
46
+ </ul>
47
+
48
+ <p>para</p>
49
+
50
+ <ul>
51
+ <li>
52
+ <p>first para</p>
53
+
54
+ <p>other para</p>
55
+ </li>
56
+ </ul>
57
+ <p>not in list para</p>
58
+
59
+ <ul>
60
+ <li>second para</li>
61
+ </ul>
@@ -0,0 +1,43 @@
1
+ * This is a simple list item
2
+ * Followed by another
3
+
4
+
5
+ * Followed by
6
+
7
+ a para list item
8
+ * and a normal one
9
+ * and
10
+
11
+ a para
12
+
13
+ para
14
+
15
+ * multi line
16
+ list item
17
+
18
+ para
19
+
20
+ * list item line1
21
+ one line
22
+ two lines
23
+ * list item line2
24
+ one line
25
+ two lines
26
+
27
+ para
28
+
29
+ * list item line3
30
+ one line
31
+ two lines
32
+ * list item line4
33
+ one line
34
+ two lines
35
+
36
+ para
37
+
38
+ * first para
39
+
40
+ other para
41
+ not in list para
42
+
43
+ * second para
@@ -0,0 +1,3 @@
1
+ <ul>
2
+ <li>single</li>
3
+ </ul>
@@ -0,0 +1,29 @@
1
+ <ul>
2
+ <li>not a para
3
+ here
4
+ <blockquote>
5
+ <p>blockquote</p>
6
+ </blockquote>
7
+ </li>
8
+ <li>and not
9
+ here
10
+ <blockquote>
11
+ <p>blockquote</p>
12
+ </blockquote>
13
+ </li>
14
+ <li>
15
+ <p>this is a para</p>
16
+ </li>
17
+ <li>
18
+ <blockquote>
19
+ <p>blockquote</p>
20
+ </blockquote>
21
+ </li>
22
+ <li>
23
+ <p>this too</p>
24
+ </li>
25
+ </ul>
26
+
27
+ <p>A paragraph
28
+ 1. followed not by ol
29
+ - followed not by ul</p>
@@ -0,0 +1,19 @@
1
+ * not a para
2
+ here
3
+ > blockquote
4
+
5
+ * and not
6
+ here
7
+ >blockquote
8
+
9
+ * this is a para
10
+
11
+ * > blockquote
12
+
13
+ * this too
14
+
15
+ ^
16
+
17
+ A paragraph
18
+ 1. followed not by ol
19
+ - followed not by ul
@@ -0,0 +1,17 @@
1
+ <div>
2
+ <p>test</p>
3
+ </div>
4
+
5
+ <div>
6
+ <pre><code>test
7
+ </code></pre>
8
+ <div>
9
+ <pre><code>test
10
+ </code></pre>
11
+ </div>
12
+ </div>
13
+
14
+ <div>
15
+ <pre><code>code block with &lt;/div&gt;
16
+ </code></pre>
17
+ </div>
@@ -0,0 +1 @@
1
+ :auto_parse_block_html: true
@@ -0,0 +1,14 @@
1
+ <div>
2
+ test
3
+ </div>
4
+
5
+ <div>
6
+ test
7
+ <div>
8
+ test
9
+ </div>
10
+ </div>
11
+
12
+ <div>
13
+ code block with </div>
14
+ </div>
@@ -0,0 +1,12 @@
1
+ <!--comment-->
2
+
3
+ <p>para1</p>
4
+
5
+ <!-- Comment -->
6
+
7
+ <p>para2</p>
8
+
9
+ <!--
10
+ Blah
11
+ Blah
12
+ -->
@@ -0,0 +1,12 @@
1
+ <!--comment-->
2
+
3
+ para1
4
+
5
+ <!-- Comment -->
6
+
7
+ para2
8
+
9
+ <!--
10
+ Blah
11
+ Blah
12
+ --> these chars are ignored
@@ -0,0 +1 @@
1
+ :filter_html: [p]
@@ -0,0 +1 @@
1
+ <p>filtered.</p>
@@ -0,0 +1,15 @@
1
+ <p>para</p>
2
+
3
+ <pre><code>codeblock
4
+ </code></pre>
5
+
6
+ <div>
7
+ <p>test</p>
8
+ </div>
9
+
10
+ <pre><code>&lt;p&gt;codeblock&lt;/p&gt;
11
+ </code></pre>
12
+
13
+ <div>
14
+ <p>test</p>
15
+ </div>