rpeg-multimarkdown2 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. data/LICENSE +96 -0
  2. data/README.markdown +52 -0
  3. data/Rakefile +167 -0
  4. data/bin/rpeg-multimarkdown2 +128 -0
  5. data/ext/extconf.h +3 -0
  6. data/ext/extconf.rb +15 -0
  7. data/ext/markdown.c +102 -0
  8. data/ext/markdown_lib.c +265 -0
  9. data/ext/markdown_lib.h +33 -0
  10. data/ext/markdown_output.c +2832 -0
  11. data/ext/markdown_parser.c +9091 -0
  12. data/ext/markdown_peg.h +144 -0
  13. data/ext/odf.c +183 -0
  14. data/ext/odf.h +3 -0
  15. data/ext/parsing_functions.c +199 -0
  16. data/ext/utility_functions.c +566 -0
  17. data/lib/multimarkdown2.rb +1 -0
  18. data/lib/peg_multimarkdown.rb +74 -0
  19. data/test/MultiMarkdownTest/BeamerTests/Beamer-Tables.html +76 -0
  20. data/test/MultiMarkdownTest/BeamerTests/Beamer-Tables.tex +64 -0
  21. data/test/MultiMarkdownTest/BeamerTests/Beamer-Tables.text +38 -0
  22. data/test/MultiMarkdownTest/CompatibilityTests/Automatic Labels.html +35 -0
  23. data/test/MultiMarkdownTest/CompatibilityTests/Automatic Labels.text +45 -0
  24. data/test/MultiMarkdownTest/CompatibilityTests/Base Header Level.html +14 -0
  25. data/test/MultiMarkdownTest/CompatibilityTests/Base Header Level.text +16 -0
  26. data/test/MultiMarkdownTest/CompatibilityTests/BibTeX.html +9 -0
  27. data/test/MultiMarkdownTest/CompatibilityTests/BibTeX.text +10 -0
  28. data/test/MultiMarkdownTest/CompatibilityTests/Citations.html +40 -0
  29. data/test/MultiMarkdownTest/CompatibilityTests/Citations.text +42 -0
  30. data/test/MultiMarkdownTest/CompatibilityTests/Definition Lists.html +40 -0
  31. data/test/MultiMarkdownTest/CompatibilityTests/Definition Lists.text +39 -0
  32. data/test/MultiMarkdownTest/CompatibilityTests/Dutch.html +17 -0
  33. data/test/MultiMarkdownTest/CompatibilityTests/Dutch.text +17 -0
  34. data/test/MultiMarkdownTest/CompatibilityTests/Email.html +40 -0
  35. data/test/MultiMarkdownTest/CompatibilityTests/Email.text +31 -0
  36. data/test/MultiMarkdownTest/CompatibilityTests/English.html +17 -0
  37. data/test/MultiMarkdownTest/CompatibilityTests/English.text +17 -0
  38. data/test/MultiMarkdownTest/CompatibilityTests/Errors.html +9 -0
  39. data/test/MultiMarkdownTest/CompatibilityTests/Errors.text +11 -0
  40. data/test/MultiMarkdownTest/CompatibilityTests/Footnotes.html +23 -0
  41. data/test/MultiMarkdownTest/CompatibilityTests/Footnotes.text +25 -0
  42. data/test/MultiMarkdownTest/CompatibilityTests/French.html +17 -0
  43. data/test/MultiMarkdownTest/CompatibilityTests/French.text +17 -0
  44. data/test/MultiMarkdownTest/CompatibilityTests/German.html +17 -0
  45. data/test/MultiMarkdownTest/CompatibilityTests/German.text +17 -0
  46. data/test/MultiMarkdownTest/CompatibilityTests/GermanGuillemets.html +17 -0
  47. data/test/MultiMarkdownTest/CompatibilityTests/GermanGuillemets.text +17 -0
  48. data/test/MultiMarkdownTest/CompatibilityTests/Glossary.html +29 -0
  49. data/test/MultiMarkdownTest/CompatibilityTests/Glossary.text +28 -0
  50. data/test/MultiMarkdownTest/CompatibilityTests/Headers.html +42 -0
  51. data/test/MultiMarkdownTest/CompatibilityTests/Headers.text +51 -0
  52. data/test/MultiMarkdownTest/CompatibilityTests/Line Breaks.html +13 -0
  53. data/test/MultiMarkdownTest/CompatibilityTests/Line Breaks.text +15 -0
  54. data/test/MultiMarkdownTest/CompatibilityTests/Link Attributes.html +35 -0
  55. data/test/MultiMarkdownTest/CompatibilityTests/Link Attributes.text +51 -0
  56. data/test/MultiMarkdownTest/CompatibilityTests/List Parsing.html +13 -0
  57. data/test/MultiMarkdownTest/CompatibilityTests/List Parsing.text +11 -0
  58. data/test/MultiMarkdownTest/CompatibilityTests/MarkdownInHTML.html +13 -0
  59. data/test/MultiMarkdownTest/CompatibilityTests/MarkdownInHTML.text +19 -0
  60. data/test/MultiMarkdownTest/CompatibilityTests/Math.html +14 -0
  61. data/test/MultiMarkdownTest/CompatibilityTests/Math.text +15 -0
  62. data/test/MultiMarkdownTest/CompatibilityTests/MetaData.html +14 -0
  63. data/test/MultiMarkdownTest/CompatibilityTests/MetaData.text +14 -0
  64. data/test/MultiMarkdownTest/CompatibilityTests/NotMetaData.html +3 -0
  65. data/test/MultiMarkdownTest/CompatibilityTests/NotMetaData.text +4 -0
  66. data/test/MultiMarkdownTest/CompatibilityTests/Sanity.html +77 -0
  67. data/test/MultiMarkdownTest/CompatibilityTests/Sanity.text +77 -0
  68. data/test/MultiMarkdownTest/CompatibilityTests/SmartQuotes.html +22 -0
  69. data/test/MultiMarkdownTest/CompatibilityTests/SmartQuotes.text +22 -0
  70. data/test/MultiMarkdownTest/CompatibilityTests/Swedish.html +17 -0
  71. data/test/MultiMarkdownTest/CompatibilityTests/Swedish.text +17 -0
  72. data/test/MultiMarkdownTest/CompatibilityTests/Tables.html +65 -0
  73. data/test/MultiMarkdownTest/CompatibilityTests/Tables.text +71 -0
  74. data/test/MultiMarkdownTest/MarkdownTest.pl +182 -0
  75. data/test/MultiMarkdownTest/MemoirTests/Automatic Labels.html +42 -0
  76. data/test/MultiMarkdownTest/MemoirTests/Automatic Labels.tex +47 -0
  77. data/test/MultiMarkdownTest/MemoirTests/Automatic Labels.text +46 -0
  78. data/test/MultiMarkdownTest/MemoirTests/Base Header Level.html +20 -0
  79. data/test/MultiMarkdownTest/MemoirTests/Base Header Level.tex +19 -0
  80. data/test/MultiMarkdownTest/MemoirTests/Base Header Level.text +16 -0
  81. data/test/MultiMarkdownTest/MemoirTests/BibTeX.html +17 -0
  82. data/test/MultiMarkdownTest/MemoirTests/BibTeX.tex +12 -0
  83. data/test/MultiMarkdownTest/MemoirTests/BibTeX.text +11 -0
  84. data/test/MultiMarkdownTest/MemoirTests/Citations.html +63 -0
  85. data/test/MultiMarkdownTest/MemoirTests/Citations.tex +48 -0
  86. data/test/MultiMarkdownTest/MemoirTests/Citations.text +43 -0
  87. data/test/MultiMarkdownTest/MemoirTests/Definition Lists.html +61 -0
  88. data/test/MultiMarkdownTest/MemoirTests/Definition Lists.tex +58 -0
  89. data/test/MultiMarkdownTest/MemoirTests/Definition Lists.text +40 -0
  90. data/test/MultiMarkdownTest/MemoirTests/Dutch.html +23 -0
  91. data/test/MultiMarkdownTest/MemoirTests/Dutch.tex +18 -0
  92. data/test/MultiMarkdownTest/MemoirTests/Dutch.text +17 -0
  93. data/test/MultiMarkdownTest/MemoirTests/Email.html +48 -0
  94. data/test/MultiMarkdownTest/MemoirTests/Email.tex +61 -0
  95. data/test/MultiMarkdownTest/MemoirTests/Email.text +32 -0
  96. data/test/MultiMarkdownTest/MemoirTests/English.html +23 -0
  97. data/test/MultiMarkdownTest/MemoirTests/English.tex +18 -0
  98. data/test/MultiMarkdownTest/MemoirTests/English.text +17 -0
  99. data/test/MultiMarkdownTest/MemoirTests/Footnotes.html +47 -0
  100. data/test/MultiMarkdownTest/MemoirTests/Footnotes.tex +28 -0
  101. data/test/MultiMarkdownTest/MemoirTests/Footnotes.text +26 -0
  102. data/test/MultiMarkdownTest/MemoirTests/French.html +23 -0
  103. data/test/MultiMarkdownTest/MemoirTests/French.tex +18 -0
  104. data/test/MultiMarkdownTest/MemoirTests/French.text +17 -0
  105. data/test/MultiMarkdownTest/MemoirTests/German.html +23 -0
  106. data/test/MultiMarkdownTest/MemoirTests/German.tex +18 -0
  107. data/test/MultiMarkdownTest/MemoirTests/German.text +17 -0
  108. data/test/MultiMarkdownTest/MemoirTests/GermanGuillemets.html +23 -0
  109. data/test/MultiMarkdownTest/MemoirTests/GermanGuillemets.tex +18 -0
  110. data/test/MultiMarkdownTest/MemoirTests/GermanGuillemets.text +17 -0
  111. data/test/MultiMarkdownTest/MemoirTests/Glossary.html +47 -0
  112. data/test/MultiMarkdownTest/MemoirTests/Glossary.tex +30 -0
  113. data/test/MultiMarkdownTest/MemoirTests/Glossary.text +29 -0
  114. data/test/MultiMarkdownTest/MemoirTests/Line Breaks.html +21 -0
  115. data/test/MultiMarkdownTest/MemoirTests/Line Breaks.tex +16 -0
  116. data/test/MultiMarkdownTest/MemoirTests/Line Breaks.text +16 -0
  117. data/test/MultiMarkdownTest/MemoirTests/Link Attributes.html +40 -0
  118. data/test/MultiMarkdownTest/MemoirTests/Link Attributes.tex +61 -0
  119. data/test/MultiMarkdownTest/MemoirTests/Link Attributes.text +51 -0
  120. data/test/MultiMarkdownTest/MemoirTests/Math.html +22 -0
  121. data/test/MultiMarkdownTest/MemoirTests/Math.tex +16 -0
  122. data/test/MultiMarkdownTest/MemoirTests/Math.text +16 -0
  123. data/test/MultiMarkdownTest/MemoirTests/Memoir Mode.html +24 -0
  124. data/test/MultiMarkdownTest/MemoirTests/Memoir Mode.tex +23 -0
  125. data/test/MultiMarkdownTest/MemoirTests/Memoir Mode.text +20 -0
  126. data/test/MultiMarkdownTest/MemoirTests/MetaData.html +22 -0
  127. data/test/MultiMarkdownTest/MemoirTests/MetaData.tex +14 -0
  128. data/test/MultiMarkdownTest/MemoirTests/MetaData.text +15 -0
  129. data/test/MultiMarkdownTest/MemoirTests/Sanity.html +100 -0
  130. data/test/MultiMarkdownTest/MemoirTests/Sanity.tex +101 -0
  131. data/test/MultiMarkdownTest/MemoirTests/Sanity.text +78 -0
  132. data/test/MultiMarkdownTest/MemoirTests/SmartQuotes.html +26 -0
  133. data/test/MultiMarkdownTest/MemoirTests/SmartQuotes.tex +21 -0
  134. data/test/MultiMarkdownTest/MemoirTests/SmartQuotes.text +19 -0
  135. data/test/MultiMarkdownTest/MemoirTests/Swedish.html +23 -0
  136. data/test/MultiMarkdownTest/MemoirTests/Swedish.tex +18 -0
  137. data/test/MultiMarkdownTest/MemoirTests/Swedish.text +17 -0
  138. data/test/MultiMarkdownTest/MemoirTests/Tables.html +221 -0
  139. data/test/MultiMarkdownTest/MemoirTests/Tables.tex +134 -0
  140. data/test/MultiMarkdownTest/MemoirTests/Tables.text +64 -0
  141. data/test/MultiMarkdownTest/MultiMarkdownTests/Automatic Labels.html +43 -0
  142. data/test/MultiMarkdownTest/MultiMarkdownTests/Automatic Labels.tex +46 -0
  143. data/test/MultiMarkdownTest/MultiMarkdownTests/Automatic Labels.text +45 -0
  144. data/test/MultiMarkdownTest/MultiMarkdownTests/Base Header Level.html +22 -0
  145. data/test/MultiMarkdownTest/MultiMarkdownTests/Base Header Level.tex +19 -0
  146. data/test/MultiMarkdownTest/MultiMarkdownTests/Base Header Level.text +16 -0
  147. data/test/MultiMarkdownTest/MultiMarkdownTests/BibTeX.html +18 -0
  148. data/test/MultiMarkdownTest/MultiMarkdownTests/BibTeX.tex +11 -0
  149. data/test/MultiMarkdownTest/MultiMarkdownTests/BibTex.text +10 -0
  150. data/test/MultiMarkdownTest/MultiMarkdownTests/Citations.html +64 -0
  151. data/test/MultiMarkdownTest/MultiMarkdownTests/Citations.tex +47 -0
  152. data/test/MultiMarkdownTest/MultiMarkdownTests/Citations.text +42 -0
  153. data/test/MultiMarkdownTest/MultiMarkdownTests/Definition Lists.html +57 -0
  154. data/test/MultiMarkdownTest/MultiMarkdownTests/Definition Lists.tex +57 -0
  155. data/test/MultiMarkdownTest/MultiMarkdownTests/Definition Lists.text +39 -0
  156. data/test/MultiMarkdownTest/MultiMarkdownTests/Dutch.html +25 -0
  157. data/test/MultiMarkdownTest/MultiMarkdownTests/Dutch.tex +18 -0
  158. data/test/MultiMarkdownTest/MultiMarkdownTests/Dutch.text +17 -0
  159. data/test/MultiMarkdownTest/MultiMarkdownTests/Email.html +49 -0
  160. data/test/MultiMarkdownTest/MultiMarkdownTests/Email.tex +54 -0
  161. data/test/MultiMarkdownTest/MultiMarkdownTests/Email.text +31 -0
  162. data/test/MultiMarkdownTest/MultiMarkdownTests/English.html +25 -0
  163. data/test/MultiMarkdownTest/MultiMarkdownTests/English.tex +18 -0
  164. data/test/MultiMarkdownTest/MultiMarkdownTests/English.text +17 -0
  165. data/test/MultiMarkdownTest/MultiMarkdownTests/Errors.html +18 -0
  166. data/test/MultiMarkdownTest/MultiMarkdownTests/Errors.tex +11 -0
  167. data/test/MultiMarkdownTest/MultiMarkdownTests/Errors.text +11 -0
  168. data/test/MultiMarkdownTest/MultiMarkdownTests/Footnotes.html +48 -0
  169. data/test/MultiMarkdownTest/MultiMarkdownTests/Footnotes.tex +24 -0
  170. data/test/MultiMarkdownTest/MultiMarkdownTests/Footnotes.text +25 -0
  171. data/test/MultiMarkdownTest/MultiMarkdownTests/French.html +25 -0
  172. data/test/MultiMarkdownTest/MultiMarkdownTests/French.tex +18 -0
  173. data/test/MultiMarkdownTest/MultiMarkdownTests/French.text +17 -0
  174. data/test/MultiMarkdownTest/MultiMarkdownTests/German.html +25 -0
  175. data/test/MultiMarkdownTest/MultiMarkdownTests/German.tex +18 -0
  176. data/test/MultiMarkdownTest/MultiMarkdownTests/German.text +17 -0
  177. data/test/MultiMarkdownTest/MultiMarkdownTests/GermanGuillemets.html +25 -0
  178. data/test/MultiMarkdownTest/MultiMarkdownTests/GermanGuillemets.tex +18 -0
  179. data/test/MultiMarkdownTest/MultiMarkdownTests/GermanGuillemets.text +17 -0
  180. data/test/MultiMarkdownTest/MultiMarkdownTests/Glossary.html +48 -0
  181. data/test/MultiMarkdownTest/MultiMarkdownTests/Glossary.tex +26 -0
  182. data/test/MultiMarkdownTest/MultiMarkdownTests/Glossary.text +28 -0
  183. data/test/MultiMarkdownTest/MultiMarkdownTests/Headers.html +50 -0
  184. data/test/MultiMarkdownTest/MultiMarkdownTests/Headers.tex +54 -0
  185. data/test/MultiMarkdownTest/MultiMarkdownTests/Headers.text +51 -0
  186. data/test/MultiMarkdownTest/MultiMarkdownTests/Line Breaks.html +22 -0
  187. data/test/MultiMarkdownTest/MultiMarkdownTests/Line Breaks.tex +15 -0
  188. data/test/MultiMarkdownTest/MultiMarkdownTests/Line Breaks.text +15 -0
  189. data/test/MultiMarkdownTest/MultiMarkdownTests/Link Attributes.html +56 -0
  190. data/test/MultiMarkdownTest/MultiMarkdownTests/Link Attributes.tex +60 -0
  191. data/test/MultiMarkdownTest/MultiMarkdownTests/Link Attributes.text +50 -0
  192. data/test/MultiMarkdownTest/MultiMarkdownTests/List Parsing.html +22 -0
  193. data/test/MultiMarkdownTest/MultiMarkdownTests/List Parsing.tex +17 -0
  194. data/test/MultiMarkdownTest/MultiMarkdownTests/List Parsing.text +11 -0
  195. data/test/MultiMarkdownTest/MultiMarkdownTests/MarkdownInHTML.html +21 -0
  196. data/test/MultiMarkdownTest/MultiMarkdownTests/MarkdownInHTML.tex +13 -0
  197. data/test/MultiMarkdownTest/MultiMarkdownTests/MarkdownInHTML.text +19 -0
  198. data/test/MultiMarkdownTest/MultiMarkdownTests/Math.html +23 -0
  199. data/test/MultiMarkdownTest/MultiMarkdownTests/Math.tex +15 -0
  200. data/test/MultiMarkdownTest/MultiMarkdownTests/Math.text +15 -0
  201. data/test/MultiMarkdownTest/MultiMarkdownTests/MetaData.html +23 -0
  202. data/test/MultiMarkdownTest/MultiMarkdownTests/MetaData.tex +13 -0
  203. data/test/MultiMarkdownTest/MultiMarkdownTests/MetaData.text +14 -0
  204. data/test/MultiMarkdownTest/MultiMarkdownTests/NotMetaData.html +3 -0
  205. data/test/MultiMarkdownTest/MultiMarkdownTests/NotMetaData.tex +3 -0
  206. data/test/MultiMarkdownTest/MultiMarkdownTests/NotMetaData.text +4 -0
  207. data/test/MultiMarkdownTest/MultiMarkdownTests/Sanity.html +106 -0
  208. data/test/MultiMarkdownTest/MultiMarkdownTests/Sanity.tex +100 -0
  209. data/test/MultiMarkdownTest/MultiMarkdownTests/Sanity.text +77 -0
  210. data/test/MultiMarkdownTest/MultiMarkdownTests/SmartQuotes.html +31 -0
  211. data/test/MultiMarkdownTest/MultiMarkdownTests/SmartQuotes.tex +24 -0
  212. data/test/MultiMarkdownTest/MultiMarkdownTests/SmartQuotes.text +22 -0
  213. data/test/MultiMarkdownTest/MultiMarkdownTests/Swedish.html +25 -0
  214. data/test/MultiMarkdownTest/MultiMarkdownTests/Swedish.tex +18 -0
  215. data/test/MultiMarkdownTest/MultiMarkdownTests/Swedish.text +17 -0
  216. data/test/MultiMarkdownTest/MultiMarkdownTests/Tables.html +273 -0
  217. data/test/MultiMarkdownTest/MultiMarkdownTests/Tables.tex +155 -0
  218. data/test/MultiMarkdownTest/MultiMarkdownTests/Tables.text +71 -0
  219. data/test/MultiMarkdownTest/MultiMarkdownTests/bibtex.bib +119 -0
  220. data/test/MultiMarkdownTest/README.md +58 -0
  221. data/test/MultiMarkdownTest/Tests/Amps and angle encoding.html +17 -0
  222. data/test/MultiMarkdownTest/Tests/Amps and angle encoding.text +21 -0
  223. data/test/MultiMarkdownTest/Tests/Auto links.html +18 -0
  224. data/test/MultiMarkdownTest/Tests/Auto links.text +13 -0
  225. data/test/MultiMarkdownTest/Tests/Backslash escapes.html +118 -0
  226. data/test/MultiMarkdownTest/Tests/Backslash escapes.text +120 -0
  227. data/test/MultiMarkdownTest/Tests/Blockquotes with code blocks.html +15 -0
  228. data/test/MultiMarkdownTest/Tests/Blockquotes with code blocks.text +11 -0
  229. data/test/MultiMarkdownTest/Tests/Code Blocks.html +18 -0
  230. data/test/MultiMarkdownTest/Tests/Code Blocks.text +14 -0
  231. data/test/MultiMarkdownTest/Tests/Code Spans.html +6 -0
  232. data/test/MultiMarkdownTest/Tests/Code Spans.text +6 -0
  233. data/test/MultiMarkdownTest/Tests/Compatibility.html +5 -0
  234. data/test/MultiMarkdownTest/Tests/Compatibility.text +9 -0
  235. data/test/MultiMarkdownTest/Tests/Hard-wrapped paragraphs with list-like lines.html +8 -0
  236. data/test/MultiMarkdownTest/Tests/Hard-wrapped paragraphs with list-like lines.text +8 -0
  237. data/test/MultiMarkdownTest/Tests/Horizontal rules.html +71 -0
  238. data/test/MultiMarkdownTest/Tests/Horizontal rules.text +67 -0
  239. data/test/MultiMarkdownTest/Tests/Inline HTML (Advanced).html +15 -0
  240. data/test/MultiMarkdownTest/Tests/Inline HTML (Advanced).text +15 -0
  241. data/test/MultiMarkdownTest/Tests/Inline HTML (Simple).html +72 -0
  242. data/test/MultiMarkdownTest/Tests/Inline HTML (Simple).text +69 -0
  243. data/test/MultiMarkdownTest/Tests/Inline HTML comments.html +13 -0
  244. data/test/MultiMarkdownTest/Tests/Inline HTML comments.text +13 -0
  245. data/test/MultiMarkdownTest/Tests/Links, inline style.html +11 -0
  246. data/test/MultiMarkdownTest/Tests/Links, inline style.text +12 -0
  247. data/test/MultiMarkdownTest/Tests/Links, reference style.html +52 -0
  248. data/test/MultiMarkdownTest/Tests/Links, reference style.text +71 -0
  249. data/test/MultiMarkdownTest/Tests/Links, shortcut references.html +9 -0
  250. data/test/MultiMarkdownTest/Tests/Links, shortcut references.text +20 -0
  251. data/test/MultiMarkdownTest/Tests/Literal quotes in titles.html +3 -0
  252. data/test/MultiMarkdownTest/Tests/Literal quotes in titles.text +7 -0
  253. data/test/MultiMarkdownTest/Tests/Markdown Documentation - Basics.html +314 -0
  254. data/test/MultiMarkdownTest/Tests/Markdown Documentation - Basics.text +306 -0
  255. data/test/MultiMarkdownTest/Tests/Markdown Documentation - Syntax.html +942 -0
  256. data/test/MultiMarkdownTest/Tests/Markdown Documentation - Syntax.text +888 -0
  257. data/test/MultiMarkdownTest/Tests/Nested blockquotes.html +9 -0
  258. data/test/MultiMarkdownTest/Tests/Nested blockquotes.text +5 -0
  259. data/test/MultiMarkdownTest/Tests/Ordered and unordered lists.html +148 -0
  260. data/test/MultiMarkdownTest/Tests/Ordered and unordered lists.text +131 -0
  261. data/test/MultiMarkdownTest/Tests/Strong and em together.html +7 -0
  262. data/test/MultiMarkdownTest/Tests/Strong and em together.text +7 -0
  263. data/test/MultiMarkdownTest/Tests/Tabs.html +25 -0
  264. data/test/MultiMarkdownTest/Tests/Tabs.text +21 -0
  265. data/test/MultiMarkdownTest/Tests/Tidyness.html +8 -0
  266. data/test/MultiMarkdownTest/Tests/Tidyness.text +5 -0
  267. data/test/benchmark.rb +49 -0
  268. data/test/multimarkdown_test.rb +89 -0
  269. metadata +318 -0
@@ -0,0 +1,9 @@
1
+ <blockquote>
2
+ <p>foo</p>
3
+
4
+ <blockquote>
5
+ <p>bar</p>
6
+ </blockquote>
7
+
8
+ <p>foo</p>
9
+ </blockquote>
@@ -0,0 +1,5 @@
1
+ > foo
2
+ >
3
+ > > bar
4
+ >
5
+ > foo
@@ -0,0 +1,148 @@
1
+ <h2>Unordered</h2>
2
+
3
+ <p>Asterisks tight:</p>
4
+
5
+ <ul>
6
+ <li>asterisk 1</li>
7
+ <li>asterisk 2</li>
8
+ <li>asterisk 3</li>
9
+ </ul>
10
+
11
+ <p>Asterisks loose:</p>
12
+
13
+ <ul>
14
+ <li><p>asterisk 1</p></li>
15
+ <li><p>asterisk 2</p></li>
16
+ <li><p>asterisk 3</p></li>
17
+ </ul>
18
+
19
+ <hr />
20
+
21
+ <p>Pluses tight:</p>
22
+
23
+ <ul>
24
+ <li>Plus 1</li>
25
+ <li>Plus 2</li>
26
+ <li>Plus 3</li>
27
+ </ul>
28
+
29
+ <p>Pluses loose:</p>
30
+
31
+ <ul>
32
+ <li><p>Plus 1</p></li>
33
+ <li><p>Plus 2</p></li>
34
+ <li><p>Plus 3</p></li>
35
+ </ul>
36
+
37
+ <hr />
38
+
39
+ <p>Minuses tight:</p>
40
+
41
+ <ul>
42
+ <li>Minus 1</li>
43
+ <li>Minus 2</li>
44
+ <li>Minus 3</li>
45
+ </ul>
46
+
47
+ <p>Minuses loose:</p>
48
+
49
+ <ul>
50
+ <li><p>Minus 1</p></li>
51
+ <li><p>Minus 2</p></li>
52
+ <li><p>Minus 3</p></li>
53
+ </ul>
54
+
55
+ <h2>Ordered</h2>
56
+
57
+ <p>Tight:</p>
58
+
59
+ <ol>
60
+ <li>First</li>
61
+ <li>Second</li>
62
+ <li>Third</li>
63
+ </ol>
64
+
65
+ <p>and:</p>
66
+
67
+ <ol>
68
+ <li>One</li>
69
+ <li>Two</li>
70
+ <li>Three</li>
71
+ </ol>
72
+
73
+ <p>Loose using tabs:</p>
74
+
75
+ <ol>
76
+ <li><p>First</p></li>
77
+ <li><p>Second</p></li>
78
+ <li><p>Third</p></li>
79
+ </ol>
80
+
81
+ <p>and using spaces:</p>
82
+
83
+ <ol>
84
+ <li><p>One</p></li>
85
+ <li><p>Two</p></li>
86
+ <li><p>Three</p></li>
87
+ </ol>
88
+
89
+ <p>Multiple paragraphs:</p>
90
+
91
+ <ol>
92
+ <li><p>Item 1, graf one.</p>
93
+
94
+ <p>Item 2. graf two. The quick brown fox jumped over the lazy dog's
95
+ back.</p></li>
96
+ <li><p>Item 2.</p></li>
97
+ <li><p>Item 3.</p></li>
98
+ </ol>
99
+
100
+ <h2>Nested</h2>
101
+
102
+ <ul>
103
+ <li>Tab
104
+ <ul>
105
+ <li>Tab
106
+ <ul>
107
+ <li>Tab</li>
108
+ </ul></li>
109
+ </ul></li>
110
+ </ul>
111
+
112
+ <p>Here's another:</p>
113
+
114
+ <ol>
115
+ <li>First</li>
116
+ <li>Second:
117
+ <ul>
118
+ <li>Fee</li>
119
+ <li>Fie</li>
120
+ <li>Foe</li>
121
+ </ul></li>
122
+ <li>Third</li>
123
+ </ol>
124
+
125
+ <p>Same thing but with paragraphs:</p>
126
+
127
+ <ol>
128
+ <li><p>First</p></li>
129
+ <li><p>Second:</p>
130
+
131
+ <ul>
132
+ <li>Fee</li>
133
+ <li>Fie</li>
134
+ <li>Foe</li>
135
+ </ul></li>
136
+ <li><p>Third</p></li>
137
+ </ol>
138
+
139
+
140
+ <p>This was an error in Markdown 1.0.1:</p>
141
+
142
+ <ul>
143
+ <li><p>this</p>
144
+
145
+ <ul><li>sub</li></ul>
146
+
147
+ <p>that</p></li>
148
+ </ul>
@@ -0,0 +1,131 @@
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
@@ -0,0 +1,7 @@
1
+ <p><strong><em>This is strong and em.</em></strong></p>
2
+
3
+ <p>So is <strong><em>this</em></strong> word.</p>
4
+
5
+ <p><strong><em>This is strong and em.</em></strong></p>
6
+
7
+ <p>So is <strong><em>this</em></strong> word.</p>
@@ -0,0 +1,7 @@
1
+ ***This is strong and em.***
2
+
3
+ So is ***this*** word.
4
+
5
+ ___This is strong and em.___
6
+
7
+ So is ___this___ word.
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <li><p>this is a list item
3
+ indented with tabs</p></li>
4
+ <li><p>this is a list item
5
+ indented with spaces</p></li>
6
+ </ul>
7
+
8
+ <p>Code:</p>
9
+
10
+ <pre><code>this code block is indented by one tab
11
+ </code></pre>
12
+
13
+ <p>And:</p>
14
+
15
+ <pre><code> this code block is indented by two tabs
16
+ </code></pre>
17
+
18
+ <p>And:</p>
19
+
20
+ <pre><code>+ this is an example list item
21
+ indented with tabs
22
+
23
+ + this is an example list item
24
+ indented with spaces
25
+ </code></pre>
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,8 @@
1
+ <blockquote>
2
+ <p>A list within a blockquote:</p>
3
+ <ul>
4
+ <li>asterisk 1</li>
5
+ <li>asterisk 2</li>
6
+ <li>asterisk 3</li>
7
+ </ul>
8
+ </blockquote>
@@ -0,0 +1,5 @@
1
+ > A list within a blockquote:
2
+ >
3
+ > * asterisk 1
4
+ > * asterisk 2
5
+ > * asterisk 3
data/test/benchmark.rb ADDED
@@ -0,0 +1,49 @@
1
+ require 'rubygems'
2
+
3
+ iterations = 100
4
+ test_file = "#{File.dirname(__FILE__)}/benchmark.txt"
5
+ implementations = %w[BlueCloth RDiscount Maruku MultiMarkdown]
6
+
7
+ # Attempt to require each implementation and remove any that are not
8
+ # installed.
9
+ implementations.reject! do |class_name|
10
+ begin
11
+ require class_name.downcase
12
+ false
13
+ rescue LoadError => boom
14
+ puts "#{class_name} excluded from benchmark. (Try: gem install #{class_name.downcase})"
15
+ true
16
+ end
17
+ end
18
+
19
+ # Grab actual class objects.
20
+ implementations.map! { |class_name| Object.const_get(class_name) }
21
+
22
+ # The actual benchmark.
23
+ def benchmark(implementation, text, iterations)
24
+ start = Time.now
25
+ iterations.times do |i|
26
+ implementation.new(text).to_html
27
+ end
28
+ Time.now - start
29
+ end
30
+
31
+ # Read test file
32
+ test_data = File.read(test_file)
33
+
34
+ # Prime the pump
35
+ puts "Spinning up ..."
36
+ implementations.each { |impl| benchmark(impl, test_data, 1) }
37
+
38
+ # Run benchmarks; gather results.
39
+ puts "Running benchmarks ..."
40
+ results =
41
+ implementations.inject([]) do |r,impl|
42
+ GC.start
43
+ r << [ impl, benchmark(impl, test_data, iterations) ]
44
+ end
45
+
46
+ puts "Results for #{iterations} iterations:"
47
+ results.each do |impl,time|
48
+ printf " %10s %09.06fs total time, %09.06fs average\n", "#{impl}:", time, time / iterations
49
+ end
@@ -0,0 +1,89 @@
1
+ $: << File.join(File.dirname(__FILE__), "../lib")
2
+
3
+ require 'test/unit'
4
+ require 'multimarkdown'
5
+
6
+ MARKDOWN_TEST_DIR = "#{File.dirname(__FILE__)}/MultiMarkdownTest"
7
+
8
+ class MultiMarkdownTest < Test::Unit::TestCase
9
+
10
+ def test_that_extension_methods_are_present_on_multimarkdown_class
11
+ assert MultiMarkdown.instance_methods.include?('to_html'),
12
+ "MultiMarkdown class should respond to #to_html"
13
+ end
14
+
15
+ def test_that_simple_one_liner_goes_to_html
16
+ multimarkdown = MultiMarkdown.new('Hello World.')
17
+ assert_respond_to multimarkdown, :to_html
18
+ assert_equal "<p>Hello World.</p>", multimarkdown.to_html.strip
19
+ end
20
+
21
+ def test_that_inline_multimarkdown_goes_to_html
22
+ multimarkdown = MultiMarkdown.new('_Hello World_!')
23
+ assert_respond_to multimarkdown, :to_html
24
+ assert_equal "<p><em>Hello World</em>!</p>", multimarkdown.to_html.strip
25
+ end
26
+
27
+ def test_that_multimarkdown_in_html_goes_to_html
28
+ multimarkdown = MultiMarkdown.new('Hello <span>_World_</span>!',:process_html)
29
+ assert_respond_to multimarkdown, :to_html
30
+ assert_equal "<p>Hello <span><em>World</em></span>!</p>", multimarkdown.to_html.strip
31
+ end
32
+
33
+ def test_that_bluecloth_restrictions_are_supported
34
+ multimarkdown = MultiMarkdown.new('Hello World.')
35
+ [:filter_html, :filter_styles].each do |restriction|
36
+ assert_respond_to multimarkdown, restriction
37
+ assert_respond_to multimarkdown, "#{restriction}="
38
+ end
39
+ assert_not_equal true, multimarkdown.filter_html
40
+ assert_not_equal true, multimarkdown.filter_styles
41
+
42
+ multimarkdown = MultiMarkdown.new('Hello World.', :filter_html, :filter_styles)
43
+ assert_equal true, multimarkdown.filter_html
44
+ assert_equal true, multimarkdown.filter_styles
45
+ end
46
+
47
+ def test_that_redcloth_attributes_are_supported
48
+ multimarkdown = MultiMarkdown.new('Hello World.')
49
+ assert_respond_to multimarkdown, :fold_lines
50
+ assert_respond_to multimarkdown, :fold_lines=
51
+ assert_not_equal true, multimarkdown.fold_lines
52
+
53
+ multimarkdown = MultiMarkdown.new('Hello World.', :fold_lines)
54
+ assert_equal true, multimarkdown.fold_lines
55
+ end
56
+
57
+ def test_that_redcloth_to_html_with_single_arg_is_supported
58
+ multimarkdown = MultiMarkdown.new('Hello World.')
59
+ assert_nothing_raised(ArgumentError) { multimarkdown.to_html(true) }
60
+ end
61
+
62
+
63
+
64
+ # Build tests for each file in the MarkdownTest test suite
65
+ ["Tests","MultiMarkdownTests","BeamerTests","MemoirTests"].each do |subdir|
66
+
67
+ Dir["#{MARKDOWN_TEST_DIR}/#{subdir}/*.text"].each do |text_file|
68
+
69
+ basename = File.basename(text_file).sub(/\.text$/, '')
70
+ html_file = text_file.sub(/text$/, 'html')
71
+ method_name = basename.gsub(/[-,]/, '').gsub(/\s+/, '_').downcase
72
+
73
+ define_method "test_#{method_name}" do
74
+ multimarkdown = MultiMarkdown.new(File.read(text_file),:compatibility)
75
+ actual_html = multimarkdown.to_html
76
+ assert_not_nil actual_html
77
+ end
78
+
79
+ define_method "test_#{method_name}_with_smarty_enabled" do
80
+ multimarkdown = MultiMarkdown.new(File.read(text_file), :smart)
81
+ actual_html = multimarkdown.to_html
82
+ assert_not_nil actual_html
83
+ end
84
+
85
+ end
86
+
87
+ end
88
+
89
+ end