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,650 @@
1
+
2
+ #line 1 "ragel/redcloth_attributes.c.rl"
3
+ /*
4
+ * redcloth_attributes.c.rl
5
+ *
6
+ * Copyright (C) 2009 Jason Garber
7
+ */
8
+ #define RSTRING_NOT_MODIFIED
9
+ #include <ruby.h>
10
+ #include "redcloth.h"
11
+
12
+
13
+ #line 16 "ragel/redcloth_attributes.c.rl"
14
+
15
+
16
+
17
+ #line 18 "ext/redcloth_scan/redcloth_attributes.c"
18
+ static const char _redcloth_attributes_actions[] = {
19
+ 0, 1, 2, 1, 4, 1, 5, 1,
20
+ 6, 1, 7, 1, 8, 1, 11, 1,
21
+ 12, 1, 13, 1, 15, 1, 18, 1,
22
+ 19, 2, 3, 14, 2, 10, 17, 2,
23
+ 13, 0, 2, 13, 1, 2, 13, 2,
24
+ 2, 13, 5, 2, 13, 6, 2, 13,
25
+ 7, 2, 13, 8, 3, 9, 10, 16
26
+
27
+ };
28
+
29
+ static const short _redcloth_attributes_key_offsets[] = {
30
+ 0, 0, 6, 11, 27, 33, 38, 44,
31
+ 60, 66, 87, 108, 118, 129, 137, 146,
32
+ 153, 159, 164, 180, 201, 205, 210, 224,
33
+ 240, 257, 274, 291, 304, 318, 325, 331,
34
+ 346, 360, 375, 385, 391, 406, 420, 435,
35
+ 445, 452, 462, 473, 492, 513, 535, 557,
36
+ 579, 598, 618, 634, 650, 660, 671, 690,
37
+ 711, 733, 755, 777, 796, 816, 819, 825,
38
+ 840, 854, 869, 878, 888, 899, 918, 939,
39
+ 961, 983, 1005, 1024, 1044
40
+ };
41
+
42
+ static const char _redcloth_attributes_trans_keys[] = {
43
+ 0, 9, 10, 32, 11, 13, 0, 9,
44
+ 32, 10, 13, 0, 9, 10, 32, 35,
45
+ 41, 45, 95, 11, 13, 48, 57, 65,
46
+ 90, 97, 122, 0, 9, 10, 32, 11,
47
+ 13, 0, 9, 32, 10, 13, 0, 9,
48
+ 10, 32, 11, 13, 0, 9, 10, 32,
49
+ 35, 41, 45, 95, 11, 13, 48, 57,
50
+ 65, 90, 97, 122, 0, 9, 10, 32,
51
+ 11, 13, 0, 9, 10, 32, 95, 117,
52
+ 125, 11, 13, 34, 35, 37, 39, 45,
53
+ 46, 48, 59, 65, 90, 97, 122, 0,
54
+ 9, 10, 32, 95, 117, 125, 11, 13,
55
+ 34, 35, 37, 39, 45, 46, 48, 59,
56
+ 65, 90, 97, 122, 32, 35, 45, 95,
57
+ 48, 57, 65, 90, 97, 122, 32, 35,
58
+ 41, 45, 95, 48, 57, 65, 90, 97,
59
+ 122, 45, 95, 48, 57, 65, 90, 97,
60
+ 122, 41, 45, 95, 48, 57, 65, 90,
61
+ 97, 122, 0, 32, 40, 91, 123, 9,
62
+ 13, 0, 9, 10, 32, 11, 13, 0,
63
+ 9, 32, 10, 13, 0, 9, 10, 32,
64
+ 35, 41, 45, 95, 11, 13, 48, 57,
65
+ 65, 90, 97, 122, 0, 9, 10, 32,
66
+ 95, 117, 125, 11, 13, 34, 35, 37,
67
+ 39, 45, 46, 48, 59, 65, 90, 97,
68
+ 122, 45, 95, 97, 122, 45, 93, 95,
69
+ 97, 122, 32, 95, 34, 35, 37, 39,
70
+ 45, 46, 48, 59, 65, 90, 97, 122,
71
+ 32, 95, 117, 125, 34, 35, 37, 39,
72
+ 45, 46, 48, 59, 65, 90, 97, 122,
73
+ 32, 95, 114, 117, 125, 34, 35, 37,
74
+ 39, 45, 46, 48, 59, 65, 90, 97,
75
+ 122, 32, 95, 108, 117, 125, 34, 35,
76
+ 37, 39, 45, 46, 48, 59, 65, 90,
77
+ 97, 122, 32, 40, 95, 117, 125, 34,
78
+ 35, 37, 39, 45, 46, 48, 59, 65,
79
+ 90, 97, 122, 39, 43, 61, 92, 95,
80
+ 34, 35, 45, 57, 63, 64, 97, 122,
81
+ 39, 41, 43, 61, 92, 95, 34, 35,
82
+ 45, 57, 63, 64, 97, 122, 0, 32,
83
+ 40, 91, 123, 9, 13, 0, 9, 10,
84
+ 32, 11, 13, 0, 9, 10, 32, 35,
85
+ 45, 95, 11, 13, 48, 57, 65, 90,
86
+ 97, 122, 0, 9, 10, 32, 45, 95,
87
+ 11, 13, 48, 57, 65, 90, 97, 122,
88
+ 0, 9, 10, 32, 41, 45, 95, 11,
89
+ 13, 48, 57, 65, 90, 97, 122, 0,
90
+ 9, 10, 32, 40, 46, 91, 123, 11,
91
+ 13, 0, 9, 10, 32, 11, 13, 0,
92
+ 9, 10, 32, 35, 45, 95, 11, 13,
93
+ 48, 57, 65, 90, 97, 122, 0, 9,
94
+ 10, 32, 45, 95, 11, 13, 48, 57,
95
+ 65, 90, 97, 122, 0, 9, 10, 32,
96
+ 41, 45, 95, 11, 13, 48, 57, 65,
97
+ 90, 97, 122, 0, 9, 10, 32, 40,
98
+ 46, 91, 123, 11, 13, 0, 9, 10,
99
+ 32, 46, 11, 13, 0, 9, 10, 32,
100
+ 45, 95, 11, 13, 97, 122, 0, 9,
101
+ 10, 32, 45, 93, 95, 11, 13, 97,
102
+ 122, 0, 9, 10, 32, 95, 11, 13,
103
+ 34, 35, 37, 39, 45, 46, 48, 59,
104
+ 65, 90, 97, 122, 0, 9, 10, 32,
105
+ 95, 117, 125, 11, 13, 34, 35, 37,
106
+ 39, 45, 46, 48, 59, 65, 90, 97,
107
+ 122, 0, 9, 10, 32, 95, 114, 117,
108
+ 125, 11, 13, 34, 35, 37, 39, 45,
109
+ 46, 48, 59, 65, 90, 97, 122, 0,
110
+ 9, 10, 32, 95, 108, 117, 125, 11,
111
+ 13, 34, 35, 37, 39, 45, 46, 48,
112
+ 59, 65, 90, 97, 122, 0, 9, 10,
113
+ 32, 40, 95, 117, 125, 11, 13, 34,
114
+ 35, 37, 39, 45, 46, 48, 59, 65,
115
+ 90, 97, 122, 0, 9, 10, 32, 39,
116
+ 43, 61, 92, 95, 11, 13, 34, 35,
117
+ 45, 57, 63, 64, 97, 122, 0, 9,
118
+ 10, 32, 39, 41, 43, 61, 92, 95,
119
+ 11, 13, 34, 35, 45, 57, 63, 64,
120
+ 97, 122, 0, 9, 10, 32, 35, 41,
121
+ 45, 95, 11, 13, 48, 57, 65, 90,
122
+ 97, 122, 0, 9, 10, 32, 35, 41,
123
+ 45, 95, 11, 13, 48, 57, 65, 90,
124
+ 97, 122, 0, 9, 10, 32, 45, 95,
125
+ 11, 13, 97, 122, 0, 9, 10, 32,
126
+ 45, 93, 95, 11, 13, 97, 122, 0,
127
+ 9, 10, 32, 95, 11, 13, 34, 35,
128
+ 37, 39, 45, 46, 48, 59, 65, 90,
129
+ 97, 122, 0, 9, 10, 32, 95, 117,
130
+ 125, 11, 13, 34, 35, 37, 39, 45,
131
+ 46, 48, 59, 65, 90, 97, 122, 0,
132
+ 9, 10, 32, 95, 114, 117, 125, 11,
133
+ 13, 34, 35, 37, 39, 45, 46, 48,
134
+ 59, 65, 90, 97, 122, 0, 9, 10,
135
+ 32, 95, 108, 117, 125, 11, 13, 34,
136
+ 35, 37, 39, 45, 46, 48, 59, 65,
137
+ 90, 97, 122, 0, 9, 10, 32, 40,
138
+ 95, 117, 125, 11, 13, 34, 35, 37,
139
+ 39, 45, 46, 48, 59, 65, 90, 97,
140
+ 122, 0, 9, 10, 32, 39, 43, 61,
141
+ 92, 95, 11, 13, 34, 35, 45, 57,
142
+ 63, 64, 97, 122, 0, 9, 10, 32,
143
+ 39, 41, 43, 61, 92, 95, 11, 13,
144
+ 34, 35, 45, 57, 63, 64, 97, 122,
145
+ 40, 91, 123, 0, 9, 10, 32, 11,
146
+ 13, 0, 9, 10, 32, 35, 45, 95,
147
+ 11, 13, 48, 57, 65, 90, 97, 122,
148
+ 0, 9, 10, 32, 45, 95, 11, 13,
149
+ 48, 57, 65, 90, 97, 122, 0, 9,
150
+ 10, 32, 41, 45, 95, 11, 13, 48,
151
+ 57, 65, 90, 97, 122, 0, 9, 10,
152
+ 32, 40, 91, 123, 11, 13, 0, 9,
153
+ 10, 32, 45, 95, 11, 13, 97, 122,
154
+ 0, 9, 10, 32, 45, 93, 95, 11,
155
+ 13, 97, 122, 0, 9, 10, 32, 95,
156
+ 11, 13, 34, 35, 37, 39, 45, 46,
157
+ 48, 59, 65, 90, 97, 122, 0, 9,
158
+ 10, 32, 95, 117, 125, 11, 13, 34,
159
+ 35, 37, 39, 45, 46, 48, 59, 65,
160
+ 90, 97, 122, 0, 9, 10, 32, 95,
161
+ 114, 117, 125, 11, 13, 34, 35, 37,
162
+ 39, 45, 46, 48, 59, 65, 90, 97,
163
+ 122, 0, 9, 10, 32, 95, 108, 117,
164
+ 125, 11, 13, 34, 35, 37, 39, 45,
165
+ 46, 48, 59, 65, 90, 97, 122, 0,
166
+ 9, 10, 32, 40, 95, 117, 125, 11,
167
+ 13, 34, 35, 37, 39, 45, 46, 48,
168
+ 59, 65, 90, 97, 122, 0, 9, 10,
169
+ 32, 39, 43, 61, 92, 95, 11, 13,
170
+ 34, 35, 45, 57, 63, 64, 97, 122,
171
+ 0, 9, 10, 32, 39, 41, 43, 61,
172
+ 92, 95, 11, 13, 34, 35, 45, 57,
173
+ 63, 64, 97, 122, 0, 9, 10, 32,
174
+ 35, 41, 45, 95, 11, 13, 48, 57,
175
+ 65, 90, 97, 122, 0
176
+ };
177
+
178
+ static const char _redcloth_attributes_single_lengths[] = {
179
+ 0, 4, 3, 8, 4, 3, 4, 8,
180
+ 4, 7, 7, 4, 5, 2, 3, 5,
181
+ 4, 3, 8, 7, 2, 3, 2, 4,
182
+ 5, 5, 5, 5, 6, 5, 4, 7,
183
+ 6, 7, 8, 4, 7, 6, 7, 8,
184
+ 5, 6, 7, 5, 7, 8, 8, 8,
185
+ 9, 10, 8, 8, 6, 7, 5, 7,
186
+ 8, 8, 8, 9, 10, 3, 4, 7,
187
+ 6, 7, 7, 6, 7, 5, 7, 8,
188
+ 8, 8, 9, 10, 8
189
+ };
190
+
191
+ static const char _redcloth_attributes_range_lengths[] = {
192
+ 0, 1, 1, 4, 1, 1, 1, 4,
193
+ 1, 7, 7, 3, 3, 3, 3, 1,
194
+ 1, 1, 4, 7, 1, 1, 6, 6,
195
+ 6, 6, 6, 4, 4, 1, 1, 4,
196
+ 4, 4, 1, 1, 4, 4, 4, 1,
197
+ 1, 2, 2, 7, 7, 7, 7, 7,
198
+ 5, 5, 4, 4, 2, 2, 7, 7,
199
+ 7, 7, 7, 5, 5, 0, 1, 4,
200
+ 4, 4, 1, 2, 2, 7, 7, 7,
201
+ 7, 7, 5, 5, 4
202
+ };
203
+
204
+ static const short _redcloth_attributes_index_offsets[] = {
205
+ 0, 0, 6, 11, 24, 30, 35, 41,
206
+ 54, 60, 75, 90, 98, 107, 113, 120,
207
+ 127, 133, 138, 151, 166, 170, 175, 184,
208
+ 195, 207, 219, 231, 241, 252, 259, 265,
209
+ 277, 288, 300, 310, 316, 328, 339, 351,
210
+ 361, 368, 377, 387, 400, 415, 431, 447,
211
+ 463, 478, 494, 507, 520, 529, 539, 552,
212
+ 567, 583, 599, 615, 630, 646, 650, 656,
213
+ 668, 679, 691, 700, 709, 719, 732, 747,
214
+ 763, 779, 795, 810, 826
215
+ };
216
+
217
+ static const char _redcloth_attributes_indicies[] = {
218
+ 0, 2, 3, 2, 0, 1, 0, 2,
219
+ 2, 0, 1, 0, 2, 3, 4, 5,
220
+ 6, 7, 7, 0, 7, 7, 7, 1,
221
+ 8, 10, 11, 10, 8, 9, 8, 10,
222
+ 10, 8, 9, 0, 2, 3, 13, 0,
223
+ 12, 8, 10, 11, 14, 15, 16, 17,
224
+ 17, 8, 17, 17, 17, 9, 8, 10,
225
+ 11, 18, 8, 12, 8, 10, 11, 19,
226
+ 20, 21, 22, 8, 20, 20, 20, 20,
227
+ 20, 20, 9, 0, 2, 3, 23, 24,
228
+ 25, 26, 0, 24, 24, 24, 24, 24,
229
+ 24, 1, 27, 29, 27, 27, 27, 27,
230
+ 27, 28, 30, 31, 32, 30, 30, 30,
231
+ 30, 30, 28, 33, 33, 33, 33, 33,
232
+ 28, 34, 35, 35, 35, 35, 35, 28,
233
+ 28, 28, 37, 38, 39, 28, 36, 40,
234
+ 42, 43, 42, 40, 41, 40, 42, 42,
235
+ 40, 41, 40, 42, 43, 44, 45, 46,
236
+ 47, 47, 40, 47, 47, 47, 41, 40,
237
+ 42, 43, 48, 49, 50, 51, 40, 49,
238
+ 49, 49, 49, 49, 49, 41, 52, 52,
239
+ 52, 28, 53, 54, 53, 53, 28, 55,
240
+ 55, 55, 55, 55, 55, 55, 55, 28,
241
+ 56, 56, 57, 58, 56, 56, 56, 56,
242
+ 56, 56, 28, 56, 56, 59, 57, 58,
243
+ 56, 56, 56, 56, 56, 56, 28, 56,
244
+ 56, 60, 57, 58, 56, 56, 56, 56,
245
+ 56, 56, 28, 56, 61, 56, 57, 58,
246
+ 56, 56, 56, 56, 56, 56, 28, 62,
247
+ 62, 62, 62, 62, 62, 62, 62, 62,
248
+ 28, 62, 56, 62, 62, 62, 62, 62,
249
+ 62, 62, 62, 28, 28, 28, 64, 65,
250
+ 66, 28, 63, 67, 2, 3, 2, 67,
251
+ 1, 67, 2, 3, 68, 69, 70, 70,
252
+ 67, 70, 70, 70, 1, 67, 2, 3,
253
+ 2, 71, 71, 67, 71, 71, 71, 1,
254
+ 67, 2, 3, 2, 72, 73, 73, 67,
255
+ 73, 73, 73, 1, 67, 2, 3, 13,
256
+ 74, 75, 76, 77, 67, 12, 78, 10,
257
+ 11, 10, 78, 9, 78, 10, 11, 79,
258
+ 80, 81, 81, 78, 81, 81, 81, 9,
259
+ 78, 10, 11, 10, 82, 82, 78, 82,
260
+ 82, 82, 9, 78, 10, 11, 10, 83,
261
+ 84, 84, 78, 84, 84, 84, 9, 78,
262
+ 10, 11, 18, 74, 75, 76, 77, 78,
263
+ 12, 78, 10, 11, 18, 75, 78, 12,
264
+ 78, 10, 11, 10, 85, 85, 78, 85,
265
+ 9, 78, 10, 11, 10, 86, 87, 86,
266
+ 78, 86, 9, 78, 10, 11, 88, 89,
267
+ 78, 89, 89, 89, 89, 89, 89, 9,
268
+ 78, 10, 11, 19, 20, 21, 22, 78,
269
+ 20, 20, 20, 20, 20, 20, 9, 78,
270
+ 10, 11, 19, 20, 90, 21, 22, 78,
271
+ 20, 20, 20, 20, 20, 20, 9, 78,
272
+ 10, 11, 19, 20, 91, 21, 22, 78,
273
+ 20, 20, 20, 20, 20, 20, 9, 78,
274
+ 10, 11, 19, 92, 20, 21, 22, 78,
275
+ 20, 20, 20, 20, 20, 20, 9, 78,
276
+ 10, 11, 10, 93, 93, 93, 93, 93,
277
+ 78, 93, 93, 93, 93, 9, 78, 10,
278
+ 11, 10, 93, 20, 93, 93, 93, 93,
279
+ 78, 93, 93, 93, 93, 9, 78, 10,
280
+ 11, 14, 15, 16, 17, 17, 78, 17,
281
+ 17, 17, 9, 67, 2, 3, 4, 5,
282
+ 6, 7, 7, 67, 7, 7, 7, 1,
283
+ 67, 2, 3, 2, 94, 94, 67, 94,
284
+ 1, 67, 2, 3, 2, 95, 96, 95,
285
+ 67, 95, 1, 67, 2, 3, 97, 98,
286
+ 67, 98, 98, 98, 98, 98, 98, 1,
287
+ 67, 2, 3, 23, 24, 25, 26, 67,
288
+ 24, 24, 24, 24, 24, 24, 1, 67,
289
+ 2, 3, 23, 24, 99, 25, 26, 67,
290
+ 24, 24, 24, 24, 24, 24, 1, 67,
291
+ 2, 3, 23, 24, 100, 25, 26, 67,
292
+ 24, 24, 24, 24, 24, 24, 1, 67,
293
+ 2, 3, 23, 101, 24, 25, 26, 67,
294
+ 24, 24, 24, 24, 24, 24, 1, 67,
295
+ 2, 3, 2, 102, 102, 102, 102, 102,
296
+ 67, 102, 102, 102, 102, 1, 67, 2,
297
+ 3, 2, 102, 24, 102, 102, 102, 102,
298
+ 67, 102, 102, 102, 102, 1, 103, 104,
299
+ 105, 28, 106, 42, 43, 42, 106, 41,
300
+ 106, 42, 43, 107, 108, 109, 109, 106,
301
+ 109, 109, 109, 41, 106, 42, 43, 42,
302
+ 110, 110, 106, 110, 110, 110, 41, 106,
303
+ 42, 43, 42, 111, 112, 112, 106, 112,
304
+ 112, 112, 41, 106, 42, 43, 42, 37,
305
+ 38, 39, 106, 36, 106, 42, 43, 42,
306
+ 113, 113, 106, 113, 41, 106, 42, 43,
307
+ 42, 114, 115, 114, 106, 114, 41, 106,
308
+ 42, 43, 116, 117, 106, 117, 117, 117,
309
+ 117, 117, 117, 41, 106, 42, 43, 48,
310
+ 49, 50, 51, 106, 49, 49, 49, 49,
311
+ 49, 49, 41, 106, 42, 43, 48, 49,
312
+ 118, 50, 51, 106, 49, 49, 49, 49,
313
+ 49, 49, 41, 106, 42, 43, 48, 49,
314
+ 119, 50, 51, 106, 49, 49, 49, 49,
315
+ 49, 49, 41, 106, 42, 43, 48, 120,
316
+ 49, 50, 51, 106, 49, 49, 49, 49,
317
+ 49, 49, 41, 106, 42, 43, 42, 121,
318
+ 121, 121, 121, 121, 106, 121, 121, 121,
319
+ 121, 41, 106, 42, 43, 42, 121, 49,
320
+ 121, 121, 121, 121, 106, 121, 121, 121,
321
+ 121, 41, 106, 42, 43, 44, 45, 46,
322
+ 47, 47, 106, 47, 47, 47, 41, 0
323
+ };
324
+
325
+ static const char _redcloth_attributes_trans_targs[] = {
326
+ 29, 30, 1, 2, 3, 32, 34, 51,
327
+ 29, 35, 4, 5, 35, 6, 7, 37,
328
+ 39, 50, 8, 9, 44, 45, 39, 10,
329
+ 55, 56, 34, 12, 0, 13, 12, 13,
330
+ 15, 14, 15, 14, 62, 63, 67, 69,
331
+ 61, 62, 16, 17, 18, 64, 66, 76,
332
+ 19, 70, 71, 66, 21, 21, 15, 23,
333
+ 23, 24, 15, 25, 26, 27, 28, 30,
334
+ 31, 52, 54, 29, 3, 32, 51, 33,
335
+ 34, 33, 36, 40, 41, 43, 29, 7,
336
+ 37, 50, 38, 39, 38, 42, 42, 39,
337
+ 9, 44, 46, 47, 48, 49, 53, 53,
338
+ 34, 10, 55, 57, 58, 59, 60, 11,
339
+ 20, 22, 61, 18, 64, 76, 65, 66,
340
+ 65, 68, 68, 66, 19, 70, 72, 73,
341
+ 74, 75
342
+ };
343
+
344
+ static const char _redcloth_attributes_trans_actions[] = {
345
+ 23, 17, 0, 0, 0, 40, 40, 17,
346
+ 21, 17, 0, 0, 31, 0, 0, 40,
347
+ 40, 17, 0, 0, 17, 17, 49, 0,
348
+ 17, 17, 49, 1, 0, 0, 0, 5,
349
+ 5, 1, 7, 0, 31, 31, 31, 31,
350
+ 19, 17, 0, 0, 0, 40, 40, 17,
351
+ 0, 17, 17, 49, 1, 0, 9, 1,
352
+ 0, 0, 11, 0, 0, 0, 0, 34,
353
+ 34, 34, 34, 28, 1, 17, 37, 37,
354
+ 43, 17, 31, 31, 31, 31, 52, 1,
355
+ 17, 37, 37, 43, 17, 37, 17, 46,
356
+ 1, 37, 17, 17, 17, 17, 37, 17,
357
+ 46, 1, 37, 17, 17, 17, 17, 3,
358
+ 3, 3, 25, 1, 17, 37, 37, 43,
359
+ 17, 37, 17, 46, 1, 37, 17, 17,
360
+ 17, 17
361
+ };
362
+
363
+ static const char _redcloth_attributes_to_state_actions[] = {
364
+ 0, 0, 0, 0, 0, 0, 0, 0,
365
+ 0, 0, 0, 0, 0, 0, 0, 0,
366
+ 0, 0, 0, 0, 0, 0, 0, 0,
367
+ 0, 0, 0, 0, 0, 13, 0, 0,
368
+ 0, 0, 0, 0, 0, 0, 0, 0,
369
+ 0, 0, 0, 0, 0, 0, 0, 0,
370
+ 0, 0, 0, 0, 0, 0, 0, 0,
371
+ 0, 0, 0, 0, 0, 13, 0, 0,
372
+ 0, 0, 0, 0, 0, 0, 0, 0,
373
+ 0, 0, 0, 0, 0
374
+ };
375
+
376
+ static const char _redcloth_attributes_from_state_actions[] = {
377
+ 0, 0, 0, 0, 0, 0, 0, 0,
378
+ 0, 0, 0, 0, 0, 0, 0, 0,
379
+ 0, 0, 0, 0, 0, 0, 0, 0,
380
+ 0, 0, 0, 0, 0, 15, 0, 0,
381
+ 0, 0, 0, 0, 0, 0, 0, 0,
382
+ 0, 0, 0, 0, 0, 0, 0, 0,
383
+ 0, 0, 0, 0, 0, 0, 0, 0,
384
+ 0, 0, 0, 0, 0, 15, 0, 0,
385
+ 0, 0, 0, 0, 0, 0, 0, 0,
386
+ 0, 0, 0, 0, 0
387
+ };
388
+
389
+ static const short _redcloth_attributes_eof_trans[] = {
390
+ 0, 1, 1, 1, 9, 9, 1, 9,
391
+ 9, 9, 1, 0, 0, 0, 0, 0,
392
+ 41, 41, 41, 41, 0, 0, 0, 0,
393
+ 0, 0, 0, 0, 0, 0, 68, 68,
394
+ 68, 68, 68, 79, 79, 79, 79, 79,
395
+ 79, 79, 79, 79, 79, 79, 79, 79,
396
+ 79, 79, 79, 68, 68, 68, 68, 68,
397
+ 68, 68, 68, 68, 68, 0, 107, 107,
398
+ 107, 107, 107, 107, 107, 107, 107, 107,
399
+ 107, 107, 107, 107, 107
400
+ };
401
+
402
+ static const int redcloth_attributes_start = 29;
403
+ static const int redcloth_attributes_error = 0;
404
+
405
+ static const int redcloth_attributes_en_inline = 61;
406
+ static const int redcloth_attributes_en_link_says = 29;
407
+
408
+
409
+ #line 19 "ragel/redcloth_attributes.c.rl"
410
+
411
+
412
+ VALUE
413
+ redcloth_attribute_parser(machine, self, p, pe)
414
+ int machine;
415
+ VALUE self;
416
+ char *p, *pe;
417
+ {
418
+ int cs, act;
419
+ char *ts = 0, *te = 0, *reg = 0, *bck = NULL, *attr_reg = NULL, *eof = NULL;
420
+ VALUE regs = rb_hash_new();
421
+ VALUE attr_regs = rb_hash_new();
422
+
423
+
424
+ #line 425 "ext/redcloth_scan/redcloth_attributes.c"
425
+ {
426
+ cs = redcloth_attributes_start;
427
+ ts = 0;
428
+ te = 0;
429
+ act = 0;
430
+ }
431
+
432
+ #line 33 "ragel/redcloth_attributes.c.rl"
433
+
434
+ cs = machine;
435
+
436
+
437
+ #line 438 "ext/redcloth_scan/redcloth_attributes.c"
438
+ {
439
+ int _klen;
440
+ unsigned int _trans;
441
+ const char *_acts;
442
+ unsigned int _nacts;
443
+ const char *_keys;
444
+
445
+ if ( p == pe )
446
+ goto _test_eof;
447
+ if ( cs == 0 )
448
+ goto _out;
449
+ _resume:
450
+ _acts = _redcloth_attributes_actions + _redcloth_attributes_from_state_actions[cs];
451
+ _nacts = (unsigned int) *_acts++;
452
+ while ( _nacts-- > 0 ) {
453
+ switch ( *_acts++ ) {
454
+ case 12:
455
+ #line 1 "NONE"
456
+ {ts = p;}
457
+ break;
458
+ #line 459 "ext/redcloth_scan/redcloth_attributes.c"
459
+ }
460
+ }
461
+
462
+ _keys = _redcloth_attributes_trans_keys + _redcloth_attributes_key_offsets[cs];
463
+ _trans = _redcloth_attributes_index_offsets[cs];
464
+
465
+ _klen = _redcloth_attributes_single_lengths[cs];
466
+ if ( _klen > 0 ) {
467
+ const char *_lower = _keys;
468
+ const char *_mid;
469
+ const char *_upper = _keys + _klen - 1;
470
+ while (1) {
471
+ if ( _upper < _lower )
472
+ break;
473
+
474
+ _mid = _lower + ((_upper-_lower) >> 1);
475
+ if ( (*p) < *_mid )
476
+ _upper = _mid - 1;
477
+ else if ( (*p) > *_mid )
478
+ _lower = _mid + 1;
479
+ else {
480
+ _trans += (unsigned int)(_mid - _keys);
481
+ goto _match;
482
+ }
483
+ }
484
+ _keys += _klen;
485
+ _trans += _klen;
486
+ }
487
+
488
+ _klen = _redcloth_attributes_range_lengths[cs];
489
+ if ( _klen > 0 ) {
490
+ const char *_lower = _keys;
491
+ const char *_mid;
492
+ const char *_upper = _keys + (_klen<<1) - 2;
493
+ while (1) {
494
+ if ( _upper < _lower )
495
+ break;
496
+
497
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
498
+ if ( (*p) < _mid[0] )
499
+ _upper = _mid - 2;
500
+ else if ( (*p) > _mid[1] )
501
+ _lower = _mid + 2;
502
+ else {
503
+ _trans += (unsigned int)((_mid - _keys)>>1);
504
+ goto _match;
505
+ }
506
+ }
507
+ _trans += _klen;
508
+ }
509
+
510
+ _match:
511
+ _trans = _redcloth_attributes_indicies[_trans];
512
+ _eof_trans:
513
+ cs = _redcloth_attributes_trans_targs[_trans];
514
+
515
+ if ( _redcloth_attributes_trans_actions[_trans] == 0 )
516
+ goto _again;
517
+
518
+ _acts = _redcloth_attributes_actions + _redcloth_attributes_trans_actions[_trans];
519
+ _nacts = (unsigned int) *_acts++;
520
+ while ( _nacts-- > 0 )
521
+ {
522
+ switch ( *_acts++ )
523
+ {
524
+ case 0:
525
+ #line 5 "ragel/redcloth_common.rl"
526
+ { MARK(); }
527
+ break;
528
+ case 1:
529
+ #line 6 "ragel/redcloth_common.rl"
530
+ { MARK_B(); }
531
+ break;
532
+ case 2:
533
+ #line 7 "ragel/redcloth_common.rl"
534
+ { MARK_ATTR(); }
535
+ break;
536
+ case 3:
537
+ #line 9 "ragel/redcloth_common.rl"
538
+ { STORE("text"); }
539
+ break;
540
+ case 4:
541
+ #line 10 "ragel/redcloth_common.rl"
542
+ { CLEAR_REGS(); RESET_REG(); }
543
+ break;
544
+ case 5:
545
+ #line 35 "ragel/redcloth_common.rl"
546
+ { STORE_ATTR("class"); }
547
+ break;
548
+ case 6:
549
+ #line 36 "ragel/redcloth_common.rl"
550
+ { STORE_ATTR("id"); }
551
+ break;
552
+ case 7:
553
+ #line 38 "ragel/redcloth_common.rl"
554
+ { STORE_ATTR("lang"); }
555
+ break;
556
+ case 8:
557
+ #line 39 "ragel/redcloth_common.rl"
558
+ { STORE_ATTR("style"); }
559
+ break;
560
+ case 9:
561
+ #line 20 "ragel/redcloth_attributes.rl"
562
+ { STORE("name"); }
563
+ break;
564
+ case 10:
565
+ #line 21 "ragel/redcloth_attributes.rl"
566
+ { STORE_B("name_without_attributes"); }
567
+ break;
568
+ case 13:
569
+ #line 1 "NONE"
570
+ {te = p+1;}
571
+ break;
572
+ case 14:
573
+ #line 16 "ragel/redcloth_attributes.rl"
574
+ {te = p;p--;{ SET_ATTRIBUTES(); }}
575
+ break;
576
+ case 15:
577
+ #line 16 "ragel/redcloth_attributes.rl"
578
+ {{p = ((te))-1;}{ SET_ATTRIBUTES(); }}
579
+ break;
580
+ case 16:
581
+ #line 25 "ragel/redcloth_attributes.rl"
582
+ {te = p;p--;{ SET_ATTRIBUTES(); }}
583
+ break;
584
+ case 17:
585
+ #line 26 "ragel/redcloth_attributes.rl"
586
+ {te = p;p--;{ SET_ATTRIBUTE("name_without_attributes", "name"); }}
587
+ break;
588
+ case 18:
589
+ #line 25 "ragel/redcloth_attributes.rl"
590
+ {{p = ((te))-1;}{ SET_ATTRIBUTES(); }}
591
+ break;
592
+ case 19:
593
+ #line 26 "ragel/redcloth_attributes.rl"
594
+ {{p = ((te))-1;}{ SET_ATTRIBUTE("name_without_attributes", "name"); }}
595
+ break;
596
+ #line 597 "ext/redcloth_scan/redcloth_attributes.c"
597
+ }
598
+ }
599
+
600
+ _again:
601
+ _acts = _redcloth_attributes_actions + _redcloth_attributes_to_state_actions[cs];
602
+ _nacts = (unsigned int) *_acts++;
603
+ while ( _nacts-- > 0 ) {
604
+ switch ( *_acts++ ) {
605
+ case 11:
606
+ #line 1 "NONE"
607
+ {ts = 0;}
608
+ break;
609
+ #line 610 "ext/redcloth_scan/redcloth_attributes.c"
610
+ }
611
+ }
612
+
613
+ if ( cs == 0 )
614
+ goto _out;
615
+ if ( ++p != pe )
616
+ goto _resume;
617
+ _test_eof: {}
618
+ if ( p == eof )
619
+ {
620
+ if ( _redcloth_attributes_eof_trans[cs] > 0 ) {
621
+ _trans = _redcloth_attributes_eof_trans[cs] - 1;
622
+ goto _eof_trans;
623
+ }
624
+ }
625
+
626
+ _out: {}
627
+ }
628
+
629
+ #line 37 "ragel/redcloth_attributes.c.rl"
630
+
631
+ return regs;
632
+ }
633
+
634
+ VALUE
635
+ redcloth_attributes(self, str)
636
+ VALUE self, str;
637
+ {
638
+ StringValue(str);
639
+ int cs = redcloth_attributes_en_inline;
640
+ return redcloth_attribute_parser(cs, self, RSTRING_PTR(str), RSTRING_PTR(str) + RSTRING_LEN(str) + 1);
641
+ }
642
+
643
+ VALUE
644
+ redcloth_link_attributes(self, str)
645
+ VALUE self, str;
646
+ {
647
+ StringValue(str);
648
+ int cs = redcloth_attributes_en_link_says;
649
+ return redcloth_attribute_parser(cs, self, RSTRING_PTR(str), RSTRING_PTR(str) + RSTRING_LEN(str) + 1);
650
+ }