maruku 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/bin/maruku +9 -3
  2. data/docs/changelog.html +52 -4
  3. data/docs/changelog.md +35 -5
  4. data/docs/index.html +13 -5
  5. data/docs/maruku.html +13 -5
  6. data/docs/maruku.md +14 -3
  7. data/lib/maruku/defaults.rb +4 -1
  8. data/lib/maruku/input/parse_block.rb +1 -1
  9. data/lib/maruku/input/parse_span_better.rb +14 -9
  10. data/lib/maruku/input/type_detection.rb +1 -1
  11. data/lib/maruku/input_textile2/t2_parser.rb +1 -1
  12. data/lib/maruku/output/to_html.rb +10 -0
  13. data/lib/maruku/output/to_latex.rb +1 -1
  14. data/lib/maruku/string_utils.rb +4 -0
  15. data/lib/maruku/tests/new_parser.rb +1 -1
  16. data/lib/maruku/version.rb +1 -1
  17. data/maruku_gem.rb +1 -1
  18. data/tests/unittest/email.md +2 -2
  19. data/tests/unittest/inline_html.md +134 -8
  20. data/tests/unittest/links.md +1 -1
  21. data/tests/unittest/links2.md +42 -0
  22. data/tests/unittest/lists10.md +62 -0
  23. data/tests/unittest/lists11.md +57 -0
  24. data/tests/unittest/lists8.md +2 -7
  25. data/tests/unittest/lists_after_paragraph.md +2 -2
  26. data/tests/unittest/misc_sw.md +2 -2
  27. data/tests/unittest/notyet/triggering.md +2 -2
  28. data/tests/unittest/paragraphs.md +1 -1
  29. data/tests/unittest/wrapping.md +2 -2
  30. data/unit_test_block.sh +5 -0
  31. data/unit_test_span.sh +2 -0
  32. metadata +215 -213
  33. data/lib/maruku/ext/diagrams/diagrams.rb +0 -8
  34. data/lib/maruku/ext/diagrams/grid.rb +0 -78
  35. data/lib/maruku/ext/diagrams/inspect.rb +0 -11
  36. data/lib/maruku/ext/diagrams/layout.rb +0 -508
  37. data/lib/maruku/ext/diagrams/parser.rb +0 -219
  38. data/lib/maruku/ext/diagrams/structures.rb +0 -168
  39. data/lib/maruku/ext/diagrams/to_html.rb +0 -37
  40. data/lib/maruku/ext/diagrams/to_latex.rb +0 -103
  41. data/lib/maruku/ext/diagrams/unittest.rb +0 -123
@@ -33,9 +33,9 @@ This is an email address:
33
33
 
34
34
 
35
35
  *** Output of Markdown.pl ***
36
- <p>This is an email address: <a href="&#x6D;&#x61;&#x69;l&#116;&#111;:&#97;&#x6E;&#x64;&#x72;&#101;&#97;&#64;&#x69;&#110;&#118;&#x61;&#x6C;&#x69;&#x64;&#46;&#x69;&#116;">&#97;&#x6E;&#x64;&#x72;&#101;&#97;&#64;&#x69;&#110;&#118;&#x61;&#x6C;&#x69;&#x64;&#46;&#x69;&#116;</a></p>
36
+ <p>This is an email address: <a href="&#x6D;&#x61;&#x69;&#x6C;&#x74;&#111;:&#x61;&#110;&#100;&#114;e&#97;&#64;&#x69;n&#118;&#x61;&#108;&#105;&#x64;&#46;&#x69;&#116;">&#x61;&#110;&#100;&#114;e&#97;&#64;&#x69;n&#118;&#x61;&#108;&#105;&#x64;&#46;&#x69;&#116;</a></p>
37
37
 
38
38
  *** Output of Markdown.pl (parsed) ***
39
- <p>This is an email address: <a href='&amp;#x6D;&amp;#x61;&amp;#x69;l&amp;#116;&amp;#111;:&amp;#97;&amp;#x6E;&amp;#x64;&amp;#x72;&amp;#101;&amp;#97;&amp;#64;&amp;#x69;&amp;#110;&amp;#118;&amp;#x61;&amp;#x6C;&amp;#x69;&amp;#x64;&amp;#46;&amp;#x69;&amp;#116;'>&#97;&#x6E;&#x64;&#x72;&#101;&#97;&#64;&#x69;&#110;&#118;&#x61;&#x6C;&#x69;&#x64;&#46;&#x69;&#116;</a
39
+ <p>This is an email address: <a href='&amp;#x6D;&amp;#x61;&amp;#x69;&amp;#x6C;&amp;#x74;&amp;#111;:&amp;#x61;&amp;#110;&amp;#100;&amp;#114;e&amp;#97;&amp;#64;&amp;#x69;n&amp;#118;&amp;#x61;&amp;#108;&amp;#105;&amp;#x64;&amp;#46;&amp;#x69;&amp;#116;'>&#x61;&#110;&#100;&#114;e&#97;&#64;&#x69;n&#118;&#x61;&#108;&#105;&#x64;&#46;&#x69;&#116;</a
40
40
  ></p
41
41
  >
@@ -87,6 +87,140 @@ md_el(:document,[
87
87
 
88
88
  <p>Result on span: <img src='http://jigsaw.w3.org/css-validator/images/vcss' /></p>
89
89
 
90
+ <p>Result alone:</p>
91
+ <img src='http://jigsaw.w3.org/css-validator/images/vcss' />
92
+ <p>Without closing:</p>
93
+ <img src='http://jigsaw.w3.org/css-validator/images/vcss' /><div>
94
+ <p>
95
+ <p>This is</p>
96
+ <em>
97
+ <p>true</p>
98
+ </em>
99
+ <p>markdown text (paragraph)</p>
100
+ </p>
101
+ <p>
102
+ <p>
103
+ <p>This is</p>
104
+ <em>
105
+ <p>true</p>
106
+ </em>
107
+ <p>markdown text (no paragraph)</p>
108
+ </p>
109
+ </p>
110
+ <p>
111
+ <p>
112
+ <p>This is</p>
113
+ <em>
114
+ <p>true</p>
115
+ </em>
116
+ <p>markdown text (block paragraph)</p>
117
+ </p>
118
+ </p>
119
+ </div><table>
120
+ <tr>
121
+ <td>
122
+ <p>This is</p>
123
+ <em>
124
+ <p>true</p>
125
+ </em>
126
+ <p>markdown text. (no par)</p>
127
+ </td>
128
+ <td>
129
+ <p>This is</p>
130
+ <em>
131
+ <p>true</p>
132
+ </em>
133
+ <p>markdown text. (par)</p>
134
+ </td>
135
+ </tr>
136
+ </table>
137
+ <p>The following is invalid HTML, and will generate an error:</p>
138
+ <pre class='markdown-html-error' style='border: solid 3px red; background-color: pink'>HTML parse error:
139
+ &lt;table&gt;
140
+ &lt;td markdown=&quot;1&quot;&gt;This is *true* markdown text. (no par)&lt;/td&gt;
141
+ &lt;td markdown=&quot;block&quot;&gt;This is *true* markdown text. (par)&lt;/td&gt;
142
+ &lt;/tr&gt;</pre><pre class='markdown-html-error' style='border: solid 3px red; background-color: pink'>HTML parse error:
143
+ &lt;/table&gt;</pre>
144
+ *** Output of to_latex ***
145
+ Input:
146
+
147
+ \begin{verbatim}<em>Emphasis</em>\end{verbatim}
148
+ Result:
149
+
150
+ Input:
151
+
152
+ \begin{verbatim}<img src="http://jigsaw.w3.org/css-validator/images/vcss"/>\end{verbatim}
153
+ Result on span:
154
+
155
+ Result alone:
156
+
157
+ Without closing:
158
+
159
+ The following is invalid HTML, and will generate an error:
160
+
161
+
162
+ *** Output of to_md ***
163
+ Input:
164
+
165
+ Result:
166
+
167
+ Input:
168
+
169
+ Result on span:
170
+
171
+ Result alone:
172
+
173
+ Without closing:
174
+
175
+ The following is invalid HTML, and will
176
+ generate an error:
177
+
178
+
179
+ *** Output of to_s ***
180
+ Input:Result: Input:Result on span: Result alone:Without closing:The following is invalid HTML, and will generate an error:
181
+ *** EOF ***
182
+
183
+
184
+
185
+
186
+ Failed tests: [:to_html]
187
+
188
+ *** Output of inspect ***
189
+ md_el(:document,[
190
+ md_par(["Input:"]),
191
+ md_el(:code,[],{:raw_code=>"<em>Emphasis</em>"},[]),
192
+ md_par(["Result: ", md_html("<em>Emphasis</em>")]),
193
+ md_par(["Input:"]),
194
+ md_el(:code,[],{:raw_code=>"<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\"/>"},[]),
195
+ md_par([
196
+ "Result on span: ",
197
+ md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />")
198
+ ]),
199
+ md_par(["Result alone:"]),
200
+ md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />"),
201
+ md_par(["Without closing:"]),
202
+ md_html("<img src=\"http://jigsaw.w3.org/css-validator/images/vcss\" />"),
203
+ md_html("<div markdown=\"1\">\n\tThis is *true* markdown text (paragraph)\n\n\t<p markdown=\"1\">\n\t\tThis is *true* markdown text (no paragraph)\n\t</p>\n\t<p markdown=\"block\">\n\t\tThis is *true* markdown text (block paragraph)\n\t</p>\n</div>"),
204
+ md_html("<table>\n<tr>\n<td markdown=\"1\">This is *true* markdown text. (no par)</td>\n<td markdown=\"block\">This is *true* markdown text. (par)</td>\n</tr>\n</table>"),
205
+ md_par(["The following is invalid HTML, and will generate an error:"]),
206
+ md_html("<table>\n<td markdown=\"1\">This is *true* markdown text. (no par)</td>\n<td markdown=\"block\">This is *true* markdown text. (par)</td>\n</tr>"),
207
+ md_html("</table>")
208
+ ],{},[])
209
+ *** Output of to_html ***
210
+ -----| WARNING | -----
211
+
212
+ <p>Input:</p>
213
+
214
+ <pre><code>&lt;em&gt;Emphasis&lt;/em&gt;</code></pre>
215
+
216
+ <p>Result: <em>Emphasis</em></p>
217
+
218
+ <p>Input:</p>
219
+
220
+ <pre><code>&lt;img src=&quot;http://jigsaw.w3.org/css-validator/images/vcss&quot;/&gt;</code></pre>
221
+
222
+ <p>Result on span: <img src='http://jigsaw.w3.org/css-validator/images/vcss' /></p>
223
+
90
224
  <p>Result alone:</p>
91
225
  <img src='http://jigsaw.w3.org/css-validator/images/vcss' />
92
226
  <p>Without closing:</p>
@@ -190,14 +324,6 @@ generate an error:
190
324
 
191
325
  *** Output of to_s ***
192
326
  Input:Result: Input:Result on span: Result alone:Without closing:The following is invalid HTML, and will generate an error:
193
- *** EOF ***
194
-
195
-
196
-
197
- OK!
198
-
199
-
200
-
201
327
  *** Output of Markdown.pl ***
202
328
  <p>CSS: style.css</p>
203
329
 
@@ -168,7 +168,7 @@ Search on GoogleSearch on GoogleSearch on GoogleSearch on GoogleSearch on Google
168
168
 
169
169
  <p>Inline with title: <a href="http://google.com "Title"">Google images</a></p>
170
170
 
171
- <p>Search on <a href="http://www.gogole.com">http://www.gogole.com</a> or <a href="http://Here.com">http://Here.com</a> or ask <a href="&#109;&#x61;&#105;&#x6C;&#116;&#111;:&#x62;&#x69;&#108;&#108;&#64;&#x67;&#111;&#111;&#103;&#x6C;&#x65;&#x2E;&#99;&#111;&#109;">&#x62;&#x69;&#108;&#108;&#64;&#x67;&#111;&#111;&#103;&#x6C;&#x65;&#x2E;&#99;&#111;&#109;</a>
171
+ <p>Search on <a href="http://www.gogole.com">http://www.gogole.com</a> or <a href="http://Here.com">http://Here.com</a> or ask <a href="&#109;ai&#x6C;&#116;&#111;:&#x62;i&#108;&#108;&#64;&#x67;&#111;&#x6F;&#x67;&#x6C;e&#46;&#99;o&#109;">&#x62;i&#108;&#108;&#64;&#x67;&#111;&#x6F;&#x67;&#x6C;e&#46;&#99;o&#109;</a>
172
172
  or you might ask bill@google.com.</p>
173
173
 
174
174
  <p>If all else fails, ask <a href="http://www.google.com">Google</a></p>
@@ -0,0 +1,42 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+ See [foo' bar]
6
+
7
+ [foo' bar]: http://agorf.gr/
8
+
9
+
10
+ *** Output of inspect ***
11
+ md_el(:document,[
12
+ md_par(["See ", md_link(["foo", md_entity("rsquo"), " bar"],"foo_bar")]),
13
+ md_ref_def("foo_bar", "http://agorf.gr/", {:title=>nil})
14
+ ],{},[])
15
+ *** Output of to_html ***
16
+
17
+ <p>See <a href='http://agorf.gr/'>foo&#8217; bar</a></p>
18
+
19
+ *** Output of to_latex ***
20
+ See \href{http://agorf.gr/}{foo'{} bar}
21
+
22
+
23
+ *** Output of to_md ***
24
+ See foo bar
25
+
26
+
27
+ *** Output of to_s ***
28
+ See foo bar
29
+ *** EOF ***
30
+
31
+
32
+
33
+ OK!
34
+
35
+
36
+
37
+ *** Output of Markdown.pl ***
38
+ <p>See [foo' bar]</p>
39
+
40
+ *** Output of Markdown.pl (parsed) ***
41
+ <p>See [foo' bar]</p
42
+ >
@@ -0,0 +1,62 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+ List:
6
+
7
+ - è`gcc`
8
+
9
+ *** Output of inspect ***
10
+ md_el(:document,[
11
+ md_par(["List:"]),
12
+ md_el(:ul,[
13
+ md_el(:li_span,["\303\250", md_code("gcc")],{:want_my_paragraph=>false},[])
14
+ ],{},[])
15
+ ],{},[])
16
+ *** Output of to_html ***
17
+
18
+ <p>List:</p>
19
+
20
+ <ul>
21
+ <li>è<code>gcc</code></li>
22
+ </ul>
23
+
24
+ *** Output of to_latex ***
25
+ List:
26
+
27
+ \begin{itemize}%
28
+ \item è\colorbox[rgb]{1.00,0.93,1.00}{\tt gcc}
29
+
30
+ \end{itemize}
31
+
32
+ *** Output of to_md ***
33
+ List:
34
+
35
+ -�
36
+
37
+
38
+ *** Output of to_s ***
39
+ List:è
40
+ *** EOF ***
41
+
42
+
43
+
44
+ OK!
45
+
46
+
47
+
48
+ *** Output of Markdown.pl ***
49
+ <p>List:</p>
50
+
51
+ <ul>
52
+ <li>è<code>gcc</code></li>
53
+ </ul>
54
+
55
+ *** Output of Markdown.pl (parsed) ***
56
+ <p>List:</p
57
+ ><ul>
58
+ <li>è<code>gcc</code
59
+ ></li
60
+ >
61
+ </ul
62
+ >
@@ -0,0 +1,57 @@
1
+ Write a comment here
2
+ *** Parameters: ***
3
+ {} # params
4
+ *** Markdown input: ***
5
+ - ένα
6
+
7
+ *** Output of inspect ***
8
+ md_el(:document,[md_par(["- \316\255\316\275\316\261"])],{},[])
9
+ *** Output of to_html ***
10
+
11
+ <p>- ένα</p>
12
+
13
+ *** Output of to_latex ***
14
+ - ένα
15
+
16
+ Non passa
17
+ *** Output of to_md ***
18
+ - ένα
19
+
20
+
21
+ *** Output of to_s ***
22
+ - ένα
23
+ *** EOF ***
24
+
25
+
26
+
27
+
28
+ Failed tests: [:to_latex]
29
+
30
+ *** Output of inspect ***
31
+ md_el(:document,[md_par(["- \316\255\316\275\316\261"])],{},[])
32
+ *** Output of to_html ***
33
+
34
+ <p>- ένα</p>
35
+
36
+ *** Output of to_latex ***
37
+ -----| WARNING | -----
38
+ - ένα
39
+
40
+
41
+ *** Output of to_md ***
42
+ - ένα
43
+
44
+
45
+ *** Output of to_s ***
46
+ - ένα
47
+ *** Output of Markdown.pl ***
48
+ <ul>
49
+ <li>ένα</li>
50
+ </ul>
51
+
52
+ *** Output of Markdown.pl (parsed) ***
53
+ <ul>
54
+ <li>ένα</li
55
+ >
56
+ </ul
57
+ >
@@ -33,12 +33,8 @@ md_el(:document,[
33
33
  *** Output of to_latex ***
34
34
  Here is a paragraph.
35
35
 
36
- \begin{itemize}%
37
- \item Item 1
38
- \item Item 2
39
- \item Item 3
36
+ * Item 1 * Item 2 * Item 3
40
37
 
41
- \end{itemize}
42
38
 
43
39
  *** Output of to_md ***
44
40
  Here is a paragraph.
@@ -55,7 +51,7 @@ Here is a paragraph.Item 1Item 2Item 3
55
51
 
56
52
 
57
53
 
58
- Failed tests: [:inspect, :to_html, :to_latex, :to_md, :to_s]
54
+ Failed tests: [:inspect, :to_html, :to_md, :to_s]
59
55
 
60
56
  *** Output of inspect ***
61
57
  -----| WARNING | -----
@@ -71,7 +67,6 @@ md_el(:document,[
71
67
  <p>* Item 1 * Item 2 * Item 3</p>
72
68
 
73
69
  *** Output of to_latex ***
74
- -----| WARNING | -----
75
70
  Here is a paragraph.
76
71
 
77
72
  * Item 1 * Item 2 * Item 3
@@ -142,9 +142,9 @@ Paragraph, list with 1 tab: * ciao
142
142
 
143
143
  Paragraph (1 space after), list with no space: * ciao
144
144
 
145
- Paragraph (2 spaces after), list with no space:\linebreak * ciao
145
+ Paragraph (2 spaces after), list with no space:\newline * ciao
146
146
 
147
- Paragraph (3 spaces after), list with no space: \linebreak * ciao
147
+ Paragraph (3 spaces after), list with no space: \newline * ciao
148
148
 
149
149
  Paragraph with block quote:
150
150
 
@@ -198,7 +198,7 @@ md_el(:document,[
198
198
  ": ",
199
199
  md_link(["JBuilder"],"jbuilder"),
200
200
  " is great software and has a free version (IMHO better than Eclipse). Java is not a pain anymore since it gained ",
201
- md_link(["generics"],"java-generics"),
201
+ md_link(["generics"],"javagenerics"),
202
202
  " and got opensourced."
203
203
  ])
204
204
  ],{:want_my_paragraph=>false},[]),
@@ -330,7 +330,7 @@ md_el(:document,[
330
330
  md_ref_def("mutopia", "http://www.mutopiaproject.org/", {:title=>nil}),
331
331
  md_ref_def("liberliber", "http://www.liberliber.it/", {:title=>nil}),
332
332
  md_ref_def("gutenberg", "http://www.gutenberg.org/", {:title=>nil}),
333
- md_ref_def("java-generics", "http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html", {:title=>nil})
333
+ md_ref_def("javagenerics", "http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html", {:title=>nil})
334
334
  ],{},[])
335
335
  *** Output of to_html ***
336
336
 
@@ -106,9 +106,9 @@ Paragraph, list with 1 tab: * ciao
106
106
 
107
107
  Paragraph (1 space after), list with no space: * ciao
108
108
 
109
- Paragraph (2 spaces after), list with no space:\linebreak * ciao
109
+ Paragraph (2 spaces after), list with no space:\newline * ciao
110
110
 
111
- Paragraph (3 spaces after), list with no space: \linebreak * ciao
111
+ Paragraph (3 spaces after), list with no space: \newline * ciao
112
112
 
113
113
  Paragraph with block quote:
114
114
 
@@ -36,7 +36,7 @@ Paragraph 1
36
36
 
37
37
  Paragraph 2
38
38
 
39
- Paragraph 3 Paragraph 4 Paragraph Br-{\tt \char62}\linebreak Paragraph 5
39
+ Paragraph 3 Paragraph 4 Paragraph Br-{\tt \char62}\newline Paragraph 5
40
40
 
41
41
 
42
42
  *** Output of to_md ***
@@ -39,10 +39,10 @@ md_el(:document,[
39
39
  </ul>
40
40
 
41
41
  *** Output of to_latex ***
42
- Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Break:\linebreak Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet.
42
+ Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Break:\newline Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet.
43
43
 
44
44
  \begin{itemize}%
45
- \item Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet Lorem ipsum Break:\linebreak Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet
45
+ \item Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet Lorem ipsum Break:\newline Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet
46
46
  \item Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet
47
47
 
48
48
  \end{itemize}
@@ -0,0 +1,5 @@
1
+
2
+ files=`find tests/unittest -name '*.md'`
3
+
4
+ ruby -Ilib bin/marutest $files
5
+
@@ -0,0 +1,2 @@
1
+ ruby -Ilib lib/maruku/tests/new_parser.rb $*
2
+