maruku 0.2.13 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. data/bin/maruku +23 -15
  2. data/bin/maruku0.3 +37 -0
  3. data/bin/marutest +277 -0
  4. data/docs/changelog-0.3.html +99 -0
  5. data/docs/changelog-0.3.md +84 -0
  6. data/docs/faq.html +46 -0
  7. data/docs/faq.md +32 -0
  8. data/docs/index.html +629 -64
  9. data/docs/markdown_extra2.html +67 -14
  10. data/docs/markdown_syntax.html +631 -94
  11. data/docs/markdown_syntax_2.html +152 -0
  12. data/docs/maruku.html +629 -64
  13. data/docs/maruku.md +108 -105
  14. data/docs/proposal.html +362 -55
  15. data/docs/proposal.md +133 -169
  16. data/docs/todo.html +30 -0
  17. data/lib/maruku.rb +13 -3
  18. data/lib/maruku/errors_management.rb +75 -0
  19. data/lib/maruku/helpers.rb +164 -0
  20. data/lib/maruku/html_helper.rb +33 -13
  21. data/lib/maruku/parse_block.rb +89 -92
  22. data/lib/maruku/parse_doc.rb +43 -18
  23. data/lib/maruku/parse_span.rb +17 -46
  24. data/lib/maruku/parse_span_better.rb +681 -0
  25. data/lib/maruku/string_utils.rb +17 -10
  26. data/lib/maruku/structures.rb +62 -35
  27. data/lib/maruku/structures_iterators.rb +39 -0
  28. data/lib/maruku/tests/benchmark.rb +12 -4
  29. data/lib/maruku/tests/new_parser.rb +318 -0
  30. data/lib/maruku/to_html.rb +113 -44
  31. data/lib/maruku/to_latex.rb +32 -14
  32. data/lib/maruku/to_markdown.rb +110 -0
  33. data/lib/maruku/toc.rb +35 -1
  34. data/lib/maruku/version.rb +10 -1
  35. data/lib/test.rb +29 -0
  36. data/tests/others/escaping.md +6 -4
  37. data/tests/others/links.md +1 -1
  38. data/tests/others/lists_after_paragraph.md +44 -0
  39. data/tests/unittest/abbreviations.md +71 -0
  40. data/tests/unittest/blank.md +43 -0
  41. data/tests/unittest/blanks_in_code.md +131 -0
  42. data/tests/unittest/code.md +64 -0
  43. data/tests/unittest/code2.md +59 -0
  44. data/tests/unittest/code3.md +121 -0
  45. data/tests/unittest/easy.md +36 -0
  46. data/tests/unittest/email.md +39 -0
  47. data/tests/unittest/encoding/iso-8859-1.md +9 -0
  48. data/tests/unittest/encoding/utf-8.md +38 -0
  49. data/tests/unittest/entities.md +174 -0
  50. data/tests/unittest/escaping.md +97 -0
  51. data/tests/unittest/extra_dl.md +81 -0
  52. data/tests/unittest/extra_header_id.md +96 -0
  53. data/tests/unittest/extra_table1.md +78 -0
  54. data/tests/unittest/footnotes.md +120 -0
  55. data/tests/unittest/headers.md +64 -0
  56. data/tests/unittest/hrule.md +77 -0
  57. data/tests/unittest/images.md +114 -0
  58. data/tests/unittest/inline_html.md +185 -0
  59. data/tests/unittest/links.md +162 -0
  60. data/tests/unittest/list1.md +80 -0
  61. data/tests/unittest/list2.md +75 -0
  62. data/tests/unittest/list3.md +111 -0
  63. data/tests/unittest/list4.md +43 -0
  64. data/tests/unittest/lists.md +262 -0
  65. data/tests/unittest/lists_after_paragraph.md +280 -0
  66. data/tests/unittest/lists_ol.md +323 -0
  67. data/tests/unittest/misc_sw.md +751 -0
  68. data/tests/unittest/notyet/escape.md +46 -0
  69. data/tests/unittest/notyet/header_after_par.md +85 -0
  70. data/tests/unittest/notyet/ticks.md +67 -0
  71. data/tests/unittest/notyet/triggering.md +210 -0
  72. data/tests/unittest/one.md +33 -0
  73. data/tests/unittest/paragraph.md +34 -0
  74. data/tests/unittest/paragraph_rules/dont_merge_ref.md +60 -0
  75. data/tests/unittest/paragraph_rules/tab_is_blank.md +43 -0
  76. data/tests/unittest/paragraphs.md +84 -0
  77. data/tests/unittest/recover/recover_links.md +32 -0
  78. data/tests/unittest/references/long_example.md +87 -0
  79. data/tests/unittest/references/spaces_and_numbers.md +27 -0
  80. data/tests/unittest/syntax_hl.md +99 -0
  81. data/tests/unittest/test.md +36 -0
  82. data/tests/unittest/wrapping.md +88 -0
  83. data/tests/utf8-files/simple.md +1 -0
  84. metadata +139 -86
  85. data/lib/maruku/maruku.rb +0 -50
  86. data/tests/a.md +0 -10
@@ -0,0 +1,46 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ `\\`
6
+
7
+ `\`
8
+ *** Output of inspect ***
9
+ md_el(:document,[md_par([md_code("\\\\")]), md_par([md_code("\\")])] )
10
+ *** Output of to_html ***
11
+
12
+ <p><code>\\</code></p>
13
+
14
+ <p><code>\</code></p>
15
+
16
+ *** Output of to_latex ***
17
+ \colorbox[rgb]{0.94,0.94,0.88}{\tt \char92\char92}
18
+
19
+ \colorbox[rgb]{0.94,0.94,0.88}{\tt \char92}
20
+
21
+
22
+ *** Output of to_s ***
23
+
24
+ *** Output of to_s ***
25
+
26
+ *** EOF ***
27
+
28
+
29
+
30
+ OK!
31
+
32
+
33
+
34
+ *** Output of Markdown.pl ***
35
+ <p><code>\\</code></p>
36
+
37
+ <p><code>\</code></p>
38
+
39
+ *** Output of Markdown.pl (parsed) ***
40
+ <p
41
+ ><code>\\</code
42
+ ></p
43
+ ><p
44
+ ><code>\</code
45
+ ></p
46
+ >
@@ -0,0 +1,85 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {:title=>"header"}
4
+ *** Markdown input: ***
5
+ Paragraph
6
+ ### header ###
7
+
8
+ Paragraph
9
+ header
10
+ ------
11
+
12
+ Paragraph
13
+ header
14
+ ======
15
+
16
+ *** Output of inspect ***
17
+ md_el(:document,[
18
+ md_par(["Paragraph"]),
19
+ md_el(:header,["header"] , {:id=>"header", :level=>3}),
20
+ md_par(["Paragraph"]),
21
+ md_el(:header,["header"] , {:id=>"header", :level=>2}),
22
+ md_par(["Paragraph"]),
23
+ md_el(:header,["header"] , {:id=>"header", :level=>1})
24
+ ] , {:title=>"header"})
25
+ *** Output of to_html ***
26
+
27
+ <p>Paragraph</p>
28
+
29
+ <h3 id='header'>header</h3>
30
+
31
+ <p>Paragraph</p>
32
+
33
+ <h2 id='header'>header</h2>
34
+
35
+ <p>Paragraph</p>
36
+
37
+ <h1 id='header'>header</h1>
38
+
39
+ *** Output of to_latex ***
40
+ Paragraph
41
+
42
+ \hypertarget{header}{}\subsubsection*{{header}}\label{header}
43
+
44
+ Paragraph
45
+
46
+ \hypertarget{header}{}\subsection*{{header}}\label{header}
47
+
48
+ Paragraph
49
+
50
+ \hypertarget{header}{}\section*{{header}}\label{header}
51
+
52
+
53
+ *** Output of to_s ***
54
+ ParagraphheaderParagraphheaderParagraphheader
55
+ *** Output of to_s ***
56
+ ParagraphheaderParagraphheaderParagraphheader
57
+ *** EOF ***
58
+
59
+
60
+
61
+ OK!
62
+
63
+
64
+
65
+ *** Output of Markdown.pl ***
66
+ <p>Paragraph</p>
67
+
68
+ <h3>header</h3>
69
+
70
+ <p>Paragraph</p>
71
+
72
+ <h2>header</h2>
73
+
74
+ <p>Paragraph</p>
75
+
76
+ <h1>header</h1>
77
+
78
+ *** Output of Markdown.pl (parsed) ***
79
+ <p>Paragraph</p
80
+ ><h3>header</h3
81
+ ><p>Paragraph</p
82
+ ><h2>header</h2
83
+ ><p>Paragraph</p
84
+ ><h1>header</h1
85
+ >
@@ -0,0 +1,67 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ `There is a literal backtick (\`) here.`
6
+
7
+ `There is a literal backtick (\\`) here.`
8
+
9
+ ``There is a literal backtick (`) here.``
10
+
11
+
12
+ *** Output of inspect ***
13
+ md_el(:document,[
14
+ md_par([md_code("There is a literal backtick (\\"), ") here.", md_code("")]),
15
+ md_par([
16
+ md_code("There is a literal backtick (\\\\"),
17
+ ") here.",
18
+ md_code("")
19
+ ]),
20
+ md_par([md_code("There is a literal backtick (`) here.")])
21
+ ] )
22
+ *** Output of to_html ***
23
+
24
+ <p><code>There is a literal backtick (\</code>) here.<code></code></p>
25
+
26
+ <p><code>There is a literal backtick (\\</code>) here.<code></code></p>
27
+
28
+ <p><code>There is a literal backtick (`) here.</code></p>
29
+
30
+ *** Output of to_latex ***
31
+ \colorbox[rgb]{0.94,0.94,0.88}{\tt \char84\char104\char101\char114\char101\char32\char105\char115\char32\char97\char32\char108\char105\char116\char101\char114\char97\char108\char32\char98\char97\char99\char107\char116\char105\char99\char107\char32\char40\char92}) here.\colorbox[rgb]{0.94,0.94,0.88}{\tt }
32
+
33
+ \colorbox[rgb]{0.94,0.94,0.88}{\tt \char84\char104\char101\char114\char101\char32\char105\char115\char32\char97\char32\char108\char105\char116\char101\char114\char97\char108\char32\char98\char97\char99\char107\char116\char105\char99\char107\char32\char40\char92\char92}) here.\colorbox[rgb]{0.94,0.94,0.88}{\tt }
34
+
35
+ \colorbox[rgb]{0.94,0.94,0.88}{\tt \char84\char104\char101\char114\char101\char32\char105\char115\char32\char97\char32\char108\char105\char116\char101\char114\char97\char108\char32\char98\char97\char99\char107\char116\char105\char99\char107\char32\char40\char96\char41\char32\char104\char101\char114\char101\char46}
36
+
37
+
38
+ *** Output of to_s ***
39
+ ) here.) here.
40
+ *** Output of to_s ***
41
+ ) here.) here.
42
+ *** EOF ***
43
+
44
+
45
+
46
+ OK!
47
+
48
+
49
+
50
+ *** Output of Markdown.pl ***
51
+ <p><code>There is a literal backtick (\</code>) here.`</p>
52
+
53
+ <p><code>There is a literal backtick (\\</code>) here.`</p>
54
+
55
+ <p><code>There is a literal backtick (`) here.</code></p>
56
+
57
+ *** Output of Markdown.pl (parsed) ***
58
+ <p
59
+ ><code>There is a literal backtick (\</code
60
+ >) here.`</p
61
+ ><p
62
+ ><code>There is a literal backtick (\\</code
63
+ >) here.`</p
64
+ ><p
65
+ ><code>There is a literal backtick (`) here.</code
66
+ ></p
67
+ >
@@ -0,0 +1,210 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ Paragraph, list with no space:
6
+ * ciao
7
+
8
+ Paragraph, list with 1 space:
9
+ * ciao
10
+
11
+ Paragraph, list with 3 space:
12
+ * ciao
13
+
14
+ Paragraph, list with 4 spaces:
15
+ * ciao
16
+
17
+ Paragraph, list with 1 tab:
18
+ * ciao
19
+
20
+ Paragraph (1 space after), list with no space:
21
+ * ciao
22
+
23
+ Paragraph (2 spaces after), list with no space:
24
+ * ciao
25
+
26
+ Paragraph (3 spaces after), list with no space:
27
+ * ciao
28
+
29
+ Paragraph with block quote:
30
+ > Quoted
31
+
32
+ Paragraph with header:
33
+ ### header ###
34
+
35
+ Paragraph with header on two lines:
36
+ header
37
+ ------
38
+
39
+ *** Output of inspect ***
40
+ md_el(:document,[
41
+ md_par(["Paragraph, list with no space: * ciao"]),
42
+ md_par(["Paragraph, list with 1 space: * ciao"]),
43
+ md_par(["Paragraph, list with 3 space: * ciao"]),
44
+ md_par(["Paragraph, list with 4 spaces: * ciao"]),
45
+ md_par(["Paragraph, list with 1 tab: * ciao"]),
46
+ md_par(["Paragraph (1 space after), list with no space: * ciao"]),
47
+ md_par([
48
+ "Paragraph (2 spaces after), list with no space:",
49
+ md_el(:linebreak,[] ),
50
+ "* ciao"
51
+ ]),
52
+ md_par([
53
+ "Paragraph (3 spaces after), list with no space: ",
54
+ md_el(:linebreak,[] ),
55
+ "* ciao"
56
+ ]),
57
+ md_par(["Paragraph with block quote:"]),
58
+ md_el(:quote,[md_par(["Quoted"])] ),
59
+ md_par(["Paragraph with header:"]),
60
+ md_el(:header,["header"] , {:id=>"header", :level=>3}),
61
+ md_par(["Paragraph with header on two lines:"]),
62
+ md_el(:header,["header"] , {:id=>"header", :level=>2})
63
+ ] )
64
+ *** Output of to_html ***
65
+
66
+ <p>Paragraph, list with no space: * ciao</p>
67
+
68
+ <p>Paragraph, list with 1 space: * ciao</p>
69
+
70
+ <p>Paragraph, list with 3 space: * ciao</p>
71
+
72
+ <p>Paragraph, list with 4 spaces: * ciao</p>
73
+
74
+ <p>Paragraph, list with 1 tab: * ciao</p>
75
+
76
+ <p>Paragraph (1 space after), list with no space: * ciao</p>
77
+
78
+ <p>Paragraph (2 spaces after), list with no space:<br />
79
+ * ciao</p>
80
+
81
+ <p>Paragraph (3 spaces after), list with no space: <br />
82
+ * ciao</p>
83
+
84
+ <p>Paragraph with block quote:</p>
85
+
86
+ <blockquote>
87
+ <p>Quoted</p>
88
+ </blockquote>
89
+
90
+ <p>Paragraph with header:</p>
91
+
92
+ <h3 id='header'>header</h3>
93
+
94
+ <p>Paragraph with header on two lines:</p>
95
+
96
+ <h2 id='header'>header</h2>
97
+
98
+ *** Output of to_latex ***
99
+ Paragraph, list with no space: * ciao
100
+
101
+ Paragraph, list with 1 space: * ciao
102
+
103
+ Paragraph, list with 3 space: * ciao
104
+
105
+ Paragraph, list with 4 spaces: * ciao
106
+
107
+ Paragraph, list with 1 tab: * ciao
108
+
109
+ Paragraph (1 space after), list with no space: * ciao
110
+
111
+ Paragraph (2 spaces after), list with no space:\linebreak * ciao
112
+
113
+ Paragraph (3 spaces after), list with no space: \linebreak * ciao
114
+
115
+ Paragraph with block quote:
116
+
117
+ \begin{quote}%
118
+ Quoted
119
+
120
+
121
+ \end{quote}
122
+ Paragraph with header:
123
+
124
+ \hypertarget{header}{}\subsubsection*{{header}}\label{header}
125
+
126
+ Paragraph with header on two lines:
127
+
128
+ \hypertarget{header}{}\subsection*{{header}}\label{header}
129
+
130
+
131
+ *** Output of to_s ***
132
+ Paragraph, list with no space: * ciaoParagraph, list with 1 space: * ciaoParagraph, list with 3 space: * ciaoParagraph, list with 4 spaces: * ciaoParagraph, list with 1 tab: * ciaoParagraph (1 space after), list with no space: * ciaoParagraph (2 spaces after), list with no space:* ciaoParagraph (3 spaces after), list with no space: * ciaoParagraph with block quote:QuotedParagraph with header:headerParagraph with header on two lines:header
133
+ *** Output of to_s ***
134
+ Paragraph, list with no space: * ciaoParagraph, list with 1 space: * ciaoParagraph, list with 3 space: * ciaoParagraph, list with 4 spaces: * ciaoParagraph, list with 1 tab: * ciaoParagraph (1 space after), list with no space: * ciaoParagraph (2 spaces after), list with no space:* ciaoParagraph (3 spaces after), list with no space: * ciaoParagraph with block quote:QuotedParagraph with header:headerParagraph with header on two lines:header
135
+ *** EOF ***
136
+
137
+
138
+
139
+ OK!
140
+
141
+
142
+
143
+ *** Output of Markdown.pl ***
144
+ <p>Paragraph, list with no space:
145
+ * ciao</p>
146
+
147
+ <p>Paragraph, list with 1 space:
148
+ * ciao</p>
149
+
150
+ <p>Paragraph, list with 3 space:
151
+ * ciao</p>
152
+
153
+ <p>Paragraph, list with 4 spaces:
154
+ * ciao</p>
155
+
156
+ <p>Paragraph, list with 1 tab:
157
+ * ciao</p>
158
+
159
+ <p>Paragraph (1 space after), list with no space:
160
+ * ciao</p>
161
+
162
+ <p>Paragraph (2 spaces after), list with no space: <br />
163
+ * ciao</p>
164
+
165
+ <p>Paragraph (3 spaces after), list with no space: <br />
166
+ * ciao</p>
167
+
168
+ <p>Paragraph with block quote:</p>
169
+
170
+ <blockquote>
171
+ <p>Quoted</p>
172
+ </blockquote>
173
+
174
+ <p>Paragraph with header:</p>
175
+
176
+ <h3>header</h3>
177
+
178
+ <p>Paragraph with header on two lines:</p>
179
+
180
+ <h2>header</h2>
181
+
182
+ *** Output of Markdown.pl (parsed) ***
183
+ <p>Paragraph, list with no space:
184
+ * ciao</p
185
+ ><p>Paragraph, list with 1 space:
186
+ * ciao</p
187
+ ><p>Paragraph, list with 3 space:
188
+ * ciao</p
189
+ ><p>Paragraph, list with 4 spaces:
190
+ * ciao</p
191
+ ><p>Paragraph, list with 1 tab:
192
+ * ciao</p
193
+ ><p>Paragraph (1 space after), list with no space:
194
+ * ciao</p
195
+ ><p>Paragraph (2 spaces after), list with no space: <br/
196
+ >
197
+ * ciao</p
198
+ ><p>Paragraph (3 spaces after), list with no space: <br/
199
+ >
200
+ * ciao</p
201
+ ><p>Paragraph with block quote:</p
202
+ ><blockquote>
203
+ <p>Quoted</p
204
+ >
205
+ </blockquote
206
+ ><p>Paragraph with header:</p
207
+ ><h3>header</h3
208
+ ><p>Paragraph with header on two lines:</p
209
+ ><h2>header</h2
210
+ >
@@ -0,0 +1,33 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ One line
6
+ *** Output of inspect ***
7
+ md_el(:document,[md_par(["One line"])] )
8
+ *** Output of to_html ***
9
+
10
+ <p>One line</p>
11
+
12
+ *** Output of to_latex ***
13
+ One line
14
+
15
+
16
+ *** Output of to_s ***
17
+ One line
18
+ *** Output of to_s ***
19
+ One line
20
+ *** EOF ***
21
+
22
+
23
+
24
+ OK!
25
+
26
+
27
+
28
+ *** Output of Markdown.pl ***
29
+ <p>One line</p>
30
+
31
+ *** Output of Markdown.pl (parsed) ***
32
+ <p>One line</p
33
+ >
@@ -0,0 +1,34 @@
1
+ Write a comment abouth the test here.
2
+ *** Parameters: ***
3
+ {}
4
+ *** Markdown input: ***
5
+ Paragraph
6
+
7
+ *** Output of inspect ***
8
+ md_el(:document,[md_par(["Paragraph"])] )
9
+ *** Output of to_html ***
10
+
11
+ <p>Paragraph</p>
12
+
13
+ *** Output of to_latex ***
14
+ Paragraph
15
+
16
+
17
+ *** Output of to_s ***
18
+ Paragraph
19
+ *** Output of to_s ***
20
+ Paragraph
21
+ *** EOF ***
22
+
23
+
24
+
25
+ OK!
26
+
27
+
28
+
29
+ *** Output of Markdown.pl ***
30
+ <p>Paragraph</p>
31
+
32
+ *** Output of Markdown.pl (parsed) ***
33
+ <p>Paragraph</p
34
+ >