parity-RedCloth 4.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gemtest +0 -0
  3. data/.rspec +1 -0
  4. data/CHANGELOG +265 -0
  5. data/COPYING +18 -0
  6. data/Gemfile +7 -0
  7. data/README.rdoc +215 -0
  8. data/Rakefile +18 -0
  9. data/bin/redcloth +28 -0
  10. data/doc/textile_reference.html +631 -0
  11. data/ext/redcloth_scan/extconf.rb +6 -0
  12. data/ext/redcloth_scan/redcloth.h +220 -0
  13. data/ext/redcloth_scan/redcloth_attributes.c +650 -0
  14. data/ext/redcloth_scan/redcloth_inline.c +8153 -0
  15. data/ext/redcloth_scan/redcloth_scan.c +24407 -0
  16. data/lib/case_sensitive_require/RedCloth.rb +6 -0
  17. data/lib/redcloth/erb_extension.rb +27 -0
  18. data/lib/redcloth/formatters/base.rb +63 -0
  19. data/lib/redcloth/formatters/html.rb +352 -0
  20. data/lib/redcloth/formatters/latex.rb +331 -0
  21. data/lib/redcloth/formatters/latex_entities.yml +2414 -0
  22. data/lib/redcloth/textile_doc.rb +113 -0
  23. data/lib/redcloth/version.rb +34 -0
  24. data/lib/redcloth.rb +45 -0
  25. data/lib/tasks/pureruby.rake +17 -0
  26. data/redcloth.gemspec +54 -0
  27. data/spec/benchmark_spec.rb +15 -0
  28. data/spec/custom_tags_spec.rb +50 -0
  29. data/spec/erb_spec.rb +10 -0
  30. data/spec/extension_spec.rb +26 -0
  31. data/spec/fixtures/basic.yml +1028 -0
  32. data/spec/fixtures/code.yml +257 -0
  33. data/spec/fixtures/definitions.yml +82 -0
  34. data/spec/fixtures/extra_whitespace.yml +64 -0
  35. data/spec/fixtures/filter_html.yml +177 -0
  36. data/spec/fixtures/filter_pba.yml +20 -0
  37. data/spec/fixtures/html.yml +348 -0
  38. data/spec/fixtures/images.yml +279 -0
  39. data/spec/fixtures/instiki.yml +38 -0
  40. data/spec/fixtures/links.yml +291 -0
  41. data/spec/fixtures/lists.yml +462 -0
  42. data/spec/fixtures/poignant.yml +89 -0
  43. data/spec/fixtures/sanitize_html.yml +42 -0
  44. data/spec/fixtures/table.yml +434 -0
  45. data/spec/fixtures/textism.yml +509 -0
  46. data/spec/fixtures/threshold.yml +762 -0
  47. data/spec/formatters/class_filtered_html_spec.rb +7 -0
  48. data/spec/formatters/filtered_html_spec.rb +7 -0
  49. data/spec/formatters/html_no_breaks_spec.rb +9 -0
  50. data/spec/formatters/html_spec.rb +13 -0
  51. data/spec/formatters/id_filtered_html_spec.rb +7 -0
  52. data/spec/formatters/latex_spec.rb +13 -0
  53. data/spec/formatters/lite_mode_html_spec.rb +7 -0
  54. data/spec/formatters/no_span_caps_html_spec.rb +7 -0
  55. data/spec/formatters/sanitized_html_spec.rb +7 -0
  56. data/spec/formatters/style_filtered_html_spec.rb +7 -0
  57. data/spec/parser_spec.rb +102 -0
  58. data/spec/spec_helper.rb +36 -0
  59. data/tasks/compile.rake +47 -0
  60. data/tasks/gems.rake +37 -0
  61. data/tasks/ragel_extension_task.rb +127 -0
  62. data/tasks/release.rake +15 -0
  63. data/tasks/rspec.rake +13 -0
  64. data/tasks/rvm.rake +79 -0
  65. metadata +239 -0
@@ -0,0 +1,38 @@
1
+ --- # Bugs filed at http://www.instiki.org/show/BugReports
2
+ in: |-
3
+ _Hi, <span class="newWikiWord">Joe Bob<a href="../show/JoeBob">?</a></span>, this should all be in italic!_
4
+ html: |-
5
+ <p><em>Hi, <span class="newWikiWord">Joe Bob<a href="../show/JoeBob">?</a></span>, this should all be in italic!</em></p>
6
+ ---
7
+ in: '*this <span>span</span> is strong*'
8
+ html: '<p><strong>this <span>span</span> is strong</strong></p>'
9
+ ---
10
+ in: '*this <span>Camel Thing<a href="../show/CamelThing">?</a></span> is strong*'
11
+ html: '<p><strong>this <span>Camel Thing<a href="../show/CamelThing">?</a></span> is strong</strong></p>'
12
+ ---
13
+ in: '_this <span>span</span> is italic_'
14
+ html: '<p><em>this <span>span</span> is italic</em></p>'
15
+ ---
16
+ in: '%{color:red}nested span because of <span><span class="newWikiWord">Camel Word<a href="../show/CamelWord">?</a></span></span>%'
17
+ html: '<p><span style="color:red;">nested span because of <span><span class="newWikiWord">Camel Word<a href="../show/CamelWord">?</a></span></span></span></p>'
18
+ ---
19
+ in: |-
20
+ h2. Version History
21
+
22
+ * "Version
23
+ 0.0":http://www.threewordslong.com/render-0-8-9b.patch - Early version using MD5 hashes.
24
+ * "Version
25
+ 0.1":http://www.threewordslong.com/chunk-0-1.patch.gz - First cut of new system. Much cleaner.
26
+ * "Version 0.2":http://www.threewordslong.com/chunk-0-2.patch.gz - Fixed problem with "authors" page and some tests.
27
+ html: |-
28
+ <h2>Version History</h2>
29
+ <ul>
30
+ <li><a href="http://www.threewordslong.com/render-0-8-9b.patch">Version<br />
31
+ 0.0</a> &#8211; Early version using MD5 hashes.</li>
32
+ <li><a href="http://www.threewordslong.com/chunk-0-1.patch.gz">Version<br />
33
+ 0.1</a> &#8211; First cut of new system. Much cleaner.</li>
34
+ <li><a href="http://www.threewordslong.com/chunk-0-2.patch.gz">Version 0.2</a> &#8211; Fixed problem with &#8220;authors&#8221; page and some tests.</li>
35
+ </ul>
36
+ ---
37
+ in: "--richSeymour --whyTheLuckyStiff"
38
+ html: "<p>&#8212;richSeymour &#8212;whyTheLuckyStiff</p>"
@@ -0,0 +1,291 @@
1
+ ---
2
+ in: '"link text":#1'
3
+ html: <p><a href="#1">link text</a></p>
4
+ ---
5
+ in: '"link text":#a'
6
+ html: <p><a href="#a">link text</a></p>
7
+ ---
8
+ in: '"link text":#a1'
9
+ html: <p><a href="#a1">link text</a></p>
10
+ ---
11
+ in: '"link text":#a10'
12
+ html: <p><a href="#a10">link text</a></p>
13
+ ---
14
+ in: '"link text":index.html'
15
+ html: <p><a href="index.html">link text</a></p>
16
+ ---
17
+ in: '"link text":index.html#1'
18
+ html: <p><a href="index.html#1">link text</a></p>
19
+ ---
20
+ in: '"link text":index.html#a'
21
+ html: <p><a href="index.html#a">link text</a></p>
22
+ ---
23
+ in: '"link text":index.html#a1'
24
+ html: <p><a href="index.html#a1">link text</a></p>
25
+ ---
26
+ in: '"link text":index.html#a10'
27
+ html: <p><a href="index.html#a10">link text</a></p>
28
+ ---
29
+ in: '"link text":http://example.com/'
30
+ html: <p><a href="http://example.com/">link text</a></p>
31
+ ---
32
+ in: '"link text":http://example.com/#1'
33
+ html: <p><a href="http://example.com/#1">link text</a></p>
34
+ ---
35
+ in: '"link text":http://example.com/#a'
36
+ html: <p><a href="http://example.com/#a">link text</a></p>
37
+ ---
38
+ in: '"link text":http://example.com/#a1'
39
+ html: <p><a href="http://example.com/#a1">link text</a></p>
40
+ ---
41
+ in: '"link text":http://example.com/#a10'
42
+ html: <p><a href="http://example.com/#a10">link text</a></p>
43
+ ---
44
+ in: '"link text":http://example.com/index.html'
45
+ html: <p><a href="http://example.com/index.html">link text</a></p>
46
+ ---
47
+ in: '"link text":http://example.com/index.html#a'
48
+ html: <p><a href="http://example.com/index.html#a">link text</a></p>
49
+ ---
50
+ in: '"link text":http://example.com/index.html#1'
51
+ html: <p><a href="http://example.com/index.html#1">link text</a></p>
52
+ ---
53
+ in: '"link text":http://example.com/index.html#a1'
54
+ html: <p><a href="http://example.com/index.html#a1">link text</a></p>
55
+ ---
56
+ in: '"link text":http://example.com/index.html#a10'
57
+ html: <p><a href="http://example.com/index.html#a10">link text</a></p>
58
+ ---
59
+ in: '"link text":http://example.com/?foo=bar'
60
+ html: <p><a href="http://example.com/?foo=bar">link text</a></p>
61
+ ---
62
+ in: '"link text":http://example.com/?foo=bar#a'
63
+ html: <p><a href="http://example.com/?foo=bar#a">link text</a></p>
64
+ ---
65
+ in: '"link & text":http://example.com/?foo=bar#a'
66
+ html: <p><a href="http://example.com/?foo=bar#a">link &amp; text</a></p>
67
+ ---
68
+ in: '"link text":http://example.com/?foo=bar#1'
69
+ html: <p><a href="http://example.com/?foo=bar#1">link text</a></p>
70
+ ---
71
+ in: '"link text":http://example.com/?foo=bar#a1'
72
+ html: <p><a href="http://example.com/?foo=bar#a1">link text</a></p>
73
+ ---
74
+ in: '"link text":http://example.com/?foo=bar#a10'
75
+ html: <p><a href="http://example.com/?foo=bar#a10">link text</a></p>
76
+ ---
77
+ in: '"link text":http://example.com/?foo=bar&a=b'
78
+ html: <p><a href="http://example.com/?foo=bar&amp;a=b">link text</a></p>
79
+ ---
80
+ in: '"link text":http://example.com/?foo=bar&a=b#1'
81
+ html: <p><a href="http://example.com/?foo=bar&amp;a=b#1">link text</a></p>
82
+ ---
83
+ in: '"link text":http://example.com/?foo=bar&a=b#a'
84
+ html: <p><a href="http://example.com/?foo=bar&amp;a=b#a">link text</a></p>
85
+ ---
86
+ in: '"link text":http://example.com/?foo=bar&a=b#a1'
87
+ html: <p><a href="http://example.com/?foo=bar&amp;a=b#a1">link text</a></p>
88
+ ---
89
+ in: '"link text":http://example.com/?foo=bar&a=b#a10'
90
+ html: <p><a href="http://example.com/?foo=bar&amp;a=b#a10">link text</a></p>
91
+ ---
92
+ in: 'This is a "link":http://example.com/'
93
+ html: <p>This is a <a href="http://example.com/">link</a></p>
94
+ ---
95
+ in: 'This is a "link":http://example.com/.'
96
+ html: <p>This is a <a href="http://example.com/">link</a>.</p>
97
+ ---
98
+ in: 'This is a "link":http://example.com/index.html.'
99
+ html: <p>This is a <a href="http://example.com/index.html">link</a>.</p>
100
+ ---
101
+ in: 'This is a "link":http://example.com/index.html#a.'
102
+ html: <p>This is a <a href="http://example.com/index.html#a">link</a>.</p>
103
+ ---
104
+ in: 'This is a "link":http://example.com/index.html#1.'
105
+ html: <p>This is a <a href="http://example.com/index.html#1">link</a>.</p>
106
+ ---
107
+ in: 'This is a "link":http://example.com/index.html#a1.'
108
+ html: <p>This is a <a href="http://example.com/index.html#a1">link</a>.</p>
109
+ ---
110
+ in: 'This is a "link":http://example.com/index.html#a10.'
111
+ html: <p>This is a <a href="http://example.com/index.html#a10">link</a>.</p>
112
+ ---
113
+ in: 'This is a "link":http://example.com/?foo=bar.'
114
+ html: <p>This is a <a href="http://example.com/?foo=bar">link</a>.</p>
115
+ ---
116
+ in: 'This is a "link":http://example.com/?foo=bar#1.'
117
+ html: <p>This is a <a href="http://example.com/?foo=bar#1">link</a>.</p>
118
+ ---
119
+ in: 'This is a "link":http://example.com/?foo=bar#a.'
120
+ html: <p>This is a <a href="http://example.com/?foo=bar#a">link</a>.</p>
121
+ ---
122
+ in: 'This is a "link":http://example.com/?foo=bar#a1.'
123
+ html: <p>This is a <a href="http://example.com/?foo=bar#a1">link</a>.</p>
124
+ ---
125
+ in: 'This is a "link":http://example.com/?foo=bar#a10.'
126
+ html: <p>This is a <a href="http://example.com/?foo=bar#a10">link</a>.</p>
127
+ ---
128
+ in: 'This is a "link":http://example.com/?foo=bar#a10, but this is not.'
129
+ html: <p>This is a <a href="http://example.com/?foo=bar#a10">link</a>, but this is not.</p>
130
+ ---
131
+ in: '(This is a "link":http://example.com/?foo=bar#a10) but this is not.'
132
+ html: <p>(This is a <a href="http://example.com/?foo=bar#a10">link</a>) but this is not.</p>
133
+ ---
134
+ in: '"link text(link title)":http://example.com/'
135
+ html: <p><a href="http://example.com/" title="link title">link text</a></p>
136
+ # ---
137
+ # in: '"link text(link title) ":http://example.com/'
138
+ # html: <p>&#8220;link text(link title) &#8220;:http://example.com/</p>
139
+ # comments: this is a real test and should pass
140
+ ---
141
+ name: link with title attribute
142
+ in: '"(link) text(link title)":http://example.com/'
143
+ html: <p><a href="http://example.com/" class="link" title="link title">text</a></p>
144
+ comments: link text can not contain parentheses
145
+ ---
146
+ name: link with space between link text and title attribute
147
+ in: '"text (link title)":http://example.com/'
148
+ html: <p><a href="http://example.com/" title="link title">text</a></p>
149
+ ---
150
+ in: '"Dive Into XML":http://www.xml.com/pub/au/164'
151
+ html: <p><a href="http://www.xml.com/pub/au/164">Dive Into <span class="caps">XML</span></a></p>
152
+ ---
153
+ in: '"Lab Exercises":../lab/exercises/exercises.html.'
154
+ html: <p><a href="../lab/exercises/exercises.html">Lab Exercises</a>.</p>
155
+ ---
156
+ in: 'Go to "discuss":http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&thread=26627 to discuss.'
157
+ html: <p>Go to <a href="http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&amp;thread=26627">discuss</a> to discuss.</p>
158
+ ---
159
+ in: '* "rubylang":http://www.ruby-lang.org/en/'
160
+ html: "<ul>\n\t<li><a href=\"http://www.ruby-lang.org/en/\">rubylang</a></li>\n</ul>"
161
+ ---
162
+ in: 'The ION coding style document found at "IONCodingStyleGuide.doc":http://perforce:8081/@md=d&cd=//&c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22 codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in ION. Test text'
163
+ html: <p>The <span class="caps">ION</span> coding style document found at <a href="http://perforce:8081/@md=d&amp;cd=//&amp;c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22">IONCodingStyleGuide.doc</a> codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in <span class="caps">ION</span>. Test text</p>
164
+ ---
165
+ in: '"testing":'
166
+ html: "<p>&#8220;testing&#8221;:</p>"
167
+ ---
168
+ name: trailing space not absorbed by link
169
+ in: '"Link":/foo.html me'
170
+ html: "<p><a href=\"/foo.html\">Link</a> me</p>"
171
+ ---
172
+ name: trailing comma stays outside link
173
+ in: '"Link":/foo.html, me'
174
+ html: "<p><a href=\"/foo.html\">Link</a>, me</p>"
175
+ ---
176
+ name: trailing exclamation stays outside link
177
+ in: '"Link":/foo.html! me'
178
+ html: "<p><a href=\"/foo.html\">Link</a>! me</p>"
179
+ ---
180
+ name: trailing semicolon stays outside link
181
+ in: '"Link":/foo.html; me'
182
+ html: "<p><a href=\"/foo.html\">Link</a>; me</p>"
183
+ ---
184
+ name: trailing period stays outside link
185
+ in: '"Link":/foo.html.'
186
+ html: "<p><a href=\"/foo.html\">Link</a>.</p>"
187
+ ---
188
+ name: whose text is a parenthetical statement
189
+ in: '"(just in case you were wondering)":http://slashdot.org/'
190
+ html: '<p><a href="http://slashdot.org/">(just in case you were wondering)</a></p>'
191
+ ---
192
+ name: that has a class and whose text is a parenthetical statement
193
+ in: '"(myclass) (just in case you were wondering)":http://slashdot.org/'
194
+ html: '<p><a href="http://slashdot.org/" class="myclass">(just in case you were wondering)</a></p>'
195
+ ---
196
+ name: link containing parentheses
197
+ in: '"It is (very) fortunate that this works":http://slashdot.org/'
198
+ html: '<p><a href="http://slashdot.org/">It is (very) fortunate that this works</a></p>'
199
+ ---
200
+ name: link containing quotes
201
+ in: '"He said it is "very unlikely" this works":http://slashdot.org/'
202
+ html: '<p><a href="http://slashdot.org/">He said it is &#8220;very unlikely&#8221; this works</a></p>'
203
+ ---
204
+ name: link containing multiple quotes
205
+ in: '"He said it is "very unlikely" the "economic stimulus" works":http://slashdot.org/'
206
+ html: '<p><a href="http://slashdot.org/">He said it is &#8220;very unlikely&#8221; the &#8220;economic stimulus&#8221; works</a></p>'
207
+ ---
208
+ name: linked quoted phrase
209
+ in: '""Open the pod bay doors please, HAL."":http://www.youtube.com/watch?v=npN9l2Bd06s'
210
+ html: '<p><a href="http://www.youtube.com/watch?v=npN9l2Bd06s">&#8220;Open the pod bay doors please, <span class="caps">HAL</span>.&#8221;</a></p>'
211
+ ---
212
+ name: link following quoted phrase
213
+ in: '"quote" text "quote" text "link":http://google.com'
214
+ html: '<p>&#8220;quote&#8221; text &#8220;quote&#8221; text <a href="http://google.com">link</a></p>'
215
+ ---
216
+ name: links containing underscores
217
+ in: 'This is a link to a "Wikipedia article about Barack":http://en.wikipedia.org/wiki/Barack_Obama'
218
+ html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Barack_Obama">Wikipedia article about Barack</a></p>'
219
+ ---
220
+ name: links containing parentheses
221
+ in: 'This is a link to a ["Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language)]'
222
+ html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a></p>'
223
+ ---
224
+ name: links contained in parentheses
225
+ in: 'This is a regular link (but in parentheses: "Google":http://www.google.com)'
226
+ html: '<p>This is a regular link (but in parentheses: <a href="http://www.google.com">Google</a>)</p>'
227
+ ---
228
+ name: links containing parentheses without brackets
229
+ in: 'This is a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language)'
230
+ html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a></p>'
231
+ ---
232
+ name: links containing parentheses period at end without brackets
233
+ in: 'This is a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language).'
234
+ html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a>.</p>'
235
+ ---
236
+ name: broken links containing parentheses without brackets
237
+ in: 'This is a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language'
238
+ html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language">Wikipedia article about Textile</a></p>'
239
+ ---
240
+ name: links containing parentheses without brackets inside a parenthesis
241
+ in: 'Textile is awesome! (Check out the "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language))'
242
+ html: '<p>Textile is awesome! (Check out the <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a>)</p>'
243
+ ---
244
+ name: quotes and follow link
245
+ in: 'Some "text" followed by a "link":http://redcloth.org.'
246
+ html: '<p>Some &#8220;text&#8221; followed by a <a href="http://redcloth.org">link</a>.</p>'
247
+ lite_mode_html: 'Some &#8220;text&#8221; followed by a <a href="http://redcloth.org">link</a>.'
248
+ ---
249
+ name: link alias containing dashes
250
+ in: |-
251
+ "link":google-rocks
252
+
253
+ [google-rocks]http://google.com
254
+ html: |-
255
+ <p><a href="http://google.com">link</a></p>
256
+ ---
257
+ name: contained in multi-paragraph quotes
258
+ in: |-
259
+ "I first learned about "Redcloth":http://redcloth.org/ several years ago.
260
+
261
+ "It's wonderful."
262
+ html: |-
263
+ <p>&#8220;I first learned about <a href="http://redcloth.org/">Redcloth</a> several years ago.</p>
264
+ <p>&#8220;It&#8217;s wonderful.&#8221;</p>
265
+ ---
266
+ name: as html in notextile contained in multi-paragraph quotes
267
+ in: |-
268
+ "Here is a <notextile><a href="http://redcloth.org/">link</a></notextile>.
269
+
270
+ "I like links."
271
+ html: |-
272
+ <p>&#8220;Here is a <a href="http://redcloth.org/">link</a>.</p>
273
+ <p>&#8220;I like links.&#8221;</p>
274
+ ---
275
+ name: contained in para with multiple quotes
276
+ in: |-
277
+ "My wife, Tipper, and I will donate 100% of the proceeds of the award to the "Alliance For Climate Protection":http://www.looktothestars.org/charity/638-alliance-for-climate-protection," said Gore in an email. "I am deeply honored to receive the Nobel Peace Prize."
278
+ html: |-
279
+ <p>&#8220;My wife, Tipper, and I will donate 100% of the proceeds of the award to the <a href="http://www.looktothestars.org/charity/638-alliance-for-climate-protection">Alliance For Climate Protection</a>,&#8221; said Gore in an email. &#8220;I am deeply honored to receive the Nobel Peace Prize.&#8221;</p>
280
+ ---
281
+ name: with caps in the title
282
+ in: |-
283
+ "British Skin Foundation (BSF)":http://www.britishskinfoundation.org.uk
284
+ html: |-
285
+ <p><a href="http://www.britishskinfoundation.org.uk" title="BSF">British Skin Foundation</a></p>
286
+ ---
287
+ name: containing HTML tags with quotes
288
+ in: |-
289
+ "<r:attachment:image name="checkmark.gif" alt="Apply online" />*apply online*":/admissions/apply/
290
+ html: |-
291
+ <p><a href="/admissions/apply/"><r:attachment:image name="checkmark.gif" alt="Apply online" /><strong>apply online</strong></a></p>