RedCloth 3.0.4 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of RedCloth might be problematic. Click here for more details.
- data/CHANGELOG +17 -0
- data/COPYING +18 -0
- data/README +156 -0
- data/Rakefile +238 -0
- data/bin/redcloth +27 -2
- data/ext/redcloth_scan/extconf.rb +9 -0
- data/ext/redcloth_scan/redcloth.h +149 -0
- data/ext/redcloth_scan/redcloth_attributes.c +650 -0
- data/ext/redcloth_scan/redcloth_attributes.rl +78 -0
- data/ext/redcloth_scan/redcloth_common.rl +113 -0
- data/ext/redcloth_scan/redcloth_inline.c +5102 -0
- data/ext/redcloth_scan/redcloth_inline.rl +282 -0
- data/ext/redcloth_scan/redcloth_scan.c +9300 -0
- data/ext/redcloth_scan/redcloth_scan.rl +523 -0
- data/extras/mingw-rbconfig.rb +176 -0
- data/extras/ragel_profiler.rb +73 -0
- data/lib/redcloth.rb +22 -1128
- data/lib/redcloth/formatters/base.rb +50 -0
- data/lib/redcloth/formatters/html.rb +342 -0
- data/lib/redcloth/formatters/latex.rb +227 -0
- data/lib/redcloth/formatters/latex_entities.yml +2414 -0
- data/lib/redcloth/textile_doc.rb +105 -0
- data/lib/redcloth/version.rb +18 -0
- data/test/basic.yml +794 -0
- data/test/code.yml +195 -0
- data/test/definitions.yml +71 -0
- data/test/extra_whitespace.yml +64 -0
- data/test/filter_html.yml +177 -0
- data/test/filter_pba.yml +12 -0
- data/test/helper.rb +108 -0
- data/test/html.yml +271 -0
- data/test/images.yml +202 -0
- data/{tests → test}/instiki.yml +14 -15
- data/test/links.yml +214 -0
- data/test/lists.yml +283 -0
- data/test/poignant.yml +89 -0
- data/test/sanitize_html.yml +42 -0
- data/test/table.yml +267 -0
- data/test/test_custom_tags.rb +46 -0
- data/test/test_extensions.rb +31 -0
- data/test/test_formatters.rb +15 -0
- data/test/test_parser.rb +68 -0
- data/test/test_restrictions.rb +41 -0
- data/test/textism.yml +480 -0
- data/test/threshold.yml +772 -0
- data/test/validate_fixtures.rb +73 -0
- metadata +94 -60
- data/doc/CHANGELOG +0 -160
- data/doc/COPYING +0 -25
- data/doc/README +0 -106
- data/doc/REFERENCE +0 -216
- data/doc/make.rb +0 -359
- data/run-tests.rb +0 -28
- data/setup.rb +0 -1376
- data/tests/code.yml +0 -105
- data/tests/hard_breaks.yml +0 -26
- data/tests/images.yml +0 -171
- data/tests/links.yml +0 -155
- data/tests/lists.yml +0 -77
- data/tests/markdown.yml +0 -218
- data/tests/poignant.yml +0 -64
- data/tests/table.yml +0 -198
- data/tests/textism.yml +0 -406
data/tests/textism.yml
DELETED
@@ -1,406 +0,0 @@
|
|
1
|
-
---
|
2
|
-
in: h1. Header 1
|
3
|
-
out: <h1>Header 1</h1>
|
4
|
-
---
|
5
|
-
in: h2. Header 2
|
6
|
-
out: <h2>Header 2</h2>
|
7
|
-
---
|
8
|
-
in: h3. Header 3
|
9
|
-
out: <h3>Header 3</h3>
|
10
|
-
---
|
11
|
-
in: |-
|
12
|
-
Any old text.
|
13
|
-
|
14
|
-
bq. A block quotation.
|
15
|
-
|
16
|
-
Any old text.
|
17
|
-
|
18
|
-
out: |-
|
19
|
-
<p>Any old text.</p>
|
20
|
-
|
21
|
-
<blockquote>
|
22
|
-
<p>A block quotation.</p>
|
23
|
-
</blockquote>
|
24
|
-
|
25
|
-
<p>Any old text.</p>
|
26
|
-
|
27
|
-
---
|
28
|
-
in: This is covered elsewhere[1].
|
29
|
-
out: <p>This is covered elsewhere<sup><a href="#fn1">1</a></sup>.</p>
|
30
|
-
---
|
31
|
-
in: fn1. Down here, in fact.
|
32
|
-
out: <p id="fn1"><sup>1</sup> Down here, in fact.</p>
|
33
|
-
---
|
34
|
-
in: |-
|
35
|
-
# A first item
|
36
|
-
# A second item
|
37
|
-
# A third item
|
38
|
-
# A fourth item
|
39
|
-
out: |-
|
40
|
-
<ol>
|
41
|
-
<li>A first item</li>
|
42
|
-
<li>A second item</li>
|
43
|
-
<li>A third item</li>
|
44
|
-
<li>A fourth item</li>
|
45
|
-
</ol>
|
46
|
-
---
|
47
|
-
in: |-
|
48
|
-
* A first item
|
49
|
-
* A second item
|
50
|
-
* A third item
|
51
|
-
* A fourth item
|
52
|
-
|
53
|
-
out: |-
|
54
|
-
<ul>
|
55
|
-
<li>A first item</li>
|
56
|
-
<li>A second item</li>
|
57
|
-
<li>A third item</li>
|
58
|
-
<li>A fourth item</li>
|
59
|
-
</ul>
|
60
|
-
|
61
|
-
---
|
62
|
-
in: _a phrase_
|
63
|
-
out: <p><em>a phrase</em></p>
|
64
|
-
---
|
65
|
-
in: __a phrase__
|
66
|
-
out: <p><i>a phrase</i></p>
|
67
|
-
---
|
68
|
-
in: '*a phrase*'
|
69
|
-
out: <p><strong>a phrase</strong></p>
|
70
|
-
---
|
71
|
-
in: '**a phrase**'
|
72
|
-
out: <p><b>a phrase</b></p>
|
73
|
-
---
|
74
|
-
in: '*(a)* a'
|
75
|
-
out: <p><strong>(a)</strong> a</p>
|
76
|
-
---
|
77
|
-
in: '*(a)* *'
|
78
|
-
out: <p><strong>(a)</strong> *</p>
|
79
|
-
---
|
80
|
-
in: Nabokov's ??Pnin??
|
81
|
-
out: <p>Nabokov’s <cite>Pnin</cite></p>
|
82
|
-
---
|
83
|
-
in: -a phrase-
|
84
|
-
out: <p><del>a phrase</del></p>
|
85
|
-
---
|
86
|
-
in: +a phrase+
|
87
|
-
out: <p><ins>a phrase</ins></p>
|
88
|
-
---
|
89
|
-
in: ^a phrase^
|
90
|
-
out: <p><sup>a phrase</sup></p>
|
91
|
-
---
|
92
|
-
in: ~a phrase~
|
93
|
-
out: <p><sub>a phrase</sub></p>
|
94
|
-
# ---
|
95
|
-
# in: %(caps)SPAN%
|
96
|
-
# out: <p><span class="caps">SPAN</span>
|
97
|
-
---
|
98
|
-
in: %{color:red}red%
|
99
|
-
out: <p><span style="color:red;">red</span></p>
|
100
|
-
---
|
101
|
-
in: %[fr]rouge%
|
102
|
-
out: <p><span lang="fr">rouge</span></p>
|
103
|
-
---
|
104
|
-
in: _(big)red_
|
105
|
-
out: <p><em class="big">red</em></p>
|
106
|
-
---
|
107
|
-
in: p(bob). A paragraph
|
108
|
-
out: <p class="bob">A paragraph</p>
|
109
|
-
---
|
110
|
-
in: p{color:#ddd}. A paragraph
|
111
|
-
out: <p style="color:#ddd;">A paragraph</p>
|
112
|
-
---
|
113
|
-
in: p[fr]. A paragraph
|
114
|
-
out: <p lang="fr">A paragraph</p>
|
115
|
-
---
|
116
|
-
in: h2()>. right-aligned header2, indented 1em both side
|
117
|
-
out: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">right-aligned header2, indented 1em both side</h2>
|
118
|
-
---
|
119
|
-
in: h3=. centered header
|
120
|
-
out: <h3 style="text-align:center;">centered header</h3>
|
121
|
-
---
|
122
|
-
in: '!>/image.gif! right-aligned image'
|
123
|
-
out: <p style="float:right"><img src="/image.gif" alt="" /> right-aligned image</p>
|
124
|
-
---
|
125
|
-
in: p[no]{color:red}. A Norse of a different colour.
|
126
|
-
out: <p style="color:red;" lang="no">A Norse of a different colour.</p>
|
127
|
-
---
|
128
|
-
in: |-
|
129
|
-
|This|is|a|simple|table|
|
130
|
-
|This|is|a|simple|row|
|
131
|
-
out: |-
|
132
|
-
<table>
|
133
|
-
<tr>
|
134
|
-
<td>This</td>
|
135
|
-
<td>is</td>
|
136
|
-
<td>a</td>
|
137
|
-
<td>simple</td>
|
138
|
-
<td>table</td>
|
139
|
-
</tr>
|
140
|
-
<tr>
|
141
|
-
<td>This</td>
|
142
|
-
<td>is</td>
|
143
|
-
<td>a</td>
|
144
|
-
<td>simple</td>
|
145
|
-
<td>row</td>
|
146
|
-
</tr>
|
147
|
-
</table>
|
148
|
-
---
|
149
|
-
in: |-
|
150
|
-
table{border:1px solid black}.
|
151
|
-
|This|is|a|row|
|
152
|
-
|This|is|a|row|
|
153
|
-
out: |-
|
154
|
-
<table style="border:1px solid black;">
|
155
|
-
<tr>
|
156
|
-
<td>This</td>
|
157
|
-
<td>is</td>
|
158
|
-
<td>a</td>
|
159
|
-
<td>row</td>
|
160
|
-
</tr>
|
161
|
-
<tr>
|
162
|
-
<td>This</td>
|
163
|
-
<td>is</td>
|
164
|
-
<td>a</td>
|
165
|
-
<td>row</td>
|
166
|
-
</tr>
|
167
|
-
</table>
|
168
|
-
---
|
169
|
-
in: '{background:#ddd}. |This|is|a|row|'
|
170
|
-
out: |-
|
171
|
-
<table>
|
172
|
-
<tr style="background:#ddd;">
|
173
|
-
<td>This</td>
|
174
|
-
<td>is</td>
|
175
|
-
<td>a</td>
|
176
|
-
<td>row</td>
|
177
|
-
</tr>
|
178
|
-
</table>
|
179
|
-
---
|
180
|
-
in: |-
|
181
|
-
|{background:#ddd}. Cell with gray background|
|
182
|
-
|\2. Cell spanning 2 columns|
|
183
|
-
|/3. Cell spanning 3 rows|
|
184
|
-
|>. Right-aligned cell|
|
185
|
-
out: |-
|
186
|
-
<table>
|
187
|
-
<tr>
|
188
|
-
<td style="background:#ddd;">Cell with gray background</td>
|
189
|
-
</tr>
|
190
|
-
<tr>
|
191
|
-
<td colspan="2">Cell spanning 2 columns</td>
|
192
|
-
</tr>
|
193
|
-
<tr>
|
194
|
-
<td rowspan="3">Cell spanning 3 rows</td>
|
195
|
-
</tr>
|
196
|
-
<tr>
|
197
|
-
<td style="text-align:right;">Right-aligned cell</td>
|
198
|
-
</tr>
|
199
|
-
</table>
|
200
|
-
# ---
|
201
|
-
# in: |-
|
202
|
-
# This is a "link":bob to Bob's website.
|
203
|
-
#
|
204
|
-
# [bob]http://itsbob.com/index.html
|
205
|
-
---
|
206
|
-
in: ACLU(American Civil Liberties Union)
|
207
|
-
out: <p><acronym title="American Civil Liberties Union">ACLU</acronym></p>
|
208
|
-
---
|
209
|
-
in: |-
|
210
|
-
h2{color:green}. This is a title
|
211
|
-
|
212
|
-
h3. This is a subhead
|
213
|
-
|
214
|
-
p{color:red}. This is some text of dubious character. Isn't the use of "quotes" just lazy writing -- and theft of 'intellectual property' besides? I think the time has come to see a block quote.
|
215
|
-
|
216
|
-
bq[fr]. This is a block quote. I'll admit it's not the most exciting block quote ever devised.
|
217
|
-
|
218
|
-
Simple list:
|
219
|
-
|
220
|
-
#{color:blue} one
|
221
|
-
# two
|
222
|
-
# three
|
223
|
-
|
224
|
-
Multi-level list:
|
225
|
-
|
226
|
-
# one
|
227
|
-
## aye
|
228
|
-
## bee
|
229
|
-
## see
|
230
|
-
# two
|
231
|
-
## x
|
232
|
-
## y
|
233
|
-
# three
|
234
|
-
|
235
|
-
Mixed list:
|
236
|
-
|
237
|
-
* Point one
|
238
|
-
* Point two
|
239
|
-
## Step 1
|
240
|
-
## Step 2
|
241
|
-
## Step 3
|
242
|
-
* Point three
|
243
|
-
** Sub point 1
|
244
|
-
** Sub point 2
|
245
|
-
|
246
|
-
|
247
|
-
Well, that went well. How about we insert an <a href="/" title="watch out">old-fashioned hypertext link</a>? Will the quote marks in the tags get messed up? No!
|
248
|
-
|
249
|
-
"This is a link (optional title)":http://www.textism.com
|
250
|
-
|
251
|
-
table{border:1px solid black}.
|
252
|
-
|_. this|_. is|_. a|_. header|
|
253
|
-
<{background:gray}. |\2. this is|{background:red;width:200px}. a|^<>{height:200px}. row|
|
254
|
-
|this|<>{padding:10px}. is|^. another|(bob#bob). row|
|
255
|
-
|
256
|
-
An image:
|
257
|
-
|
258
|
-
!/common/textist.gif(optional alt text)!
|
259
|
-
|
260
|
-
# Librarians rule
|
261
|
-
# Yes they do
|
262
|
-
# But you knew that
|
263
|
-
|
264
|
-
Some more text of dubious character. Here is a noisome string of CAPITAL letters. Here is something we want to _emphasize_.
|
265
|
-
That was a linebreak. And something to indicate *strength*. Of course I could use <em>my own HTML tags</em> if I <strong>felt</strong> like it.
|
266
|
-
|
267
|
-
h3. Coding
|
268
|
-
|
269
|
-
This <code>is some code, "isn't it"</code>. Watch those quote marks! Now for some preformatted text:
|
270
|
-
|
271
|
-
<pre>
|
272
|
-
<code>
|
273
|
-
$text = str_replace("<p>%::%</p>","",$text);
|
274
|
-
$text = str_replace("%::%</p>","",$text);
|
275
|
-
$text = str_replace("%::%","",$text);
|
276
|
-
|
277
|
-
</code>
|
278
|
-
</pre>
|
279
|
-
|
280
|
-
This isn't code.
|
281
|
-
|
282
|
-
|
283
|
-
So you see, my friends:
|
284
|
-
|
285
|
-
* The time is now
|
286
|
-
* The time is not later
|
287
|
-
* The time is not yesterday
|
288
|
-
* We must act
|
289
|
-
|
290
|
-
out: |-
|
291
|
-
<h2 style="color:green;">This is a title</h2>
|
292
|
-
|
293
|
-
<h3>This is a subhead</h3>
|
294
|
-
|
295
|
-
<p style="color:red;">This is some text of dubious character. Isn’t the use of “quotes” just lazy writing—and theft of ‘intellectual property’ besides? I think the time has come to see a block quote.</p>
|
296
|
-
|
297
|
-
<blockquote>
|
298
|
-
<p lang="fr">This is a block quote. I’ll admit it’s not the most exciting block quote ever devised.</p>
|
299
|
-
</blockquote>
|
300
|
-
|
301
|
-
<p>Simple list:</p>
|
302
|
-
<ol style="color:blue;">
|
303
|
-
<li>one</li>
|
304
|
-
<li>two</li>
|
305
|
-
<li>three</li>
|
306
|
-
</ol>
|
307
|
-
|
308
|
-
<p>Multi-level list:</p>
|
309
|
-
<ol>
|
310
|
-
<li>one
|
311
|
-
<ol>
|
312
|
-
<li>aye</li>
|
313
|
-
<li>bee</li>
|
314
|
-
<li>see</li>
|
315
|
-
</ol>
|
316
|
-
</li>
|
317
|
-
<li>two
|
318
|
-
<ol>
|
319
|
-
<li>x</li>
|
320
|
-
<li>y</li>
|
321
|
-
</ol>
|
322
|
-
</li>
|
323
|
-
<li>three</li>
|
324
|
-
</ol>
|
325
|
-
|
326
|
-
<p>Mixed list:</p>
|
327
|
-
<ul>
|
328
|
-
<li>Point one</li>
|
329
|
-
<li>Point two
|
330
|
-
<ol>
|
331
|
-
<li>Step 1</li>
|
332
|
-
<li>Step 2</li>
|
333
|
-
<li>Step 3</li>
|
334
|
-
</ol>
|
335
|
-
</li>
|
336
|
-
<li>Point three
|
337
|
-
<ul>
|
338
|
-
<li>Sub point 1</li>
|
339
|
-
<li>Sub point 2</li>
|
340
|
-
</ul></li>
|
341
|
-
</ul>
|
342
|
-
|
343
|
-
<p>Well, that went well. How about we insert an <a href="/" title="watch out">old-fashioned hypertext link</a>? Will the quote marks in the tags get messed up? No!</p>
|
344
|
-
|
345
|
-
<p><a href="http://www.textism.com" title="optional title">This is a link</a></p>
|
346
|
-
|
347
|
-
<table style="border:1px solid black;">
|
348
|
-
<tr>
|
349
|
-
<th>this</th>
|
350
|
-
<th>is</th>
|
351
|
-
<th>a</th>
|
352
|
-
<th>header</th>
|
353
|
-
</tr>
|
354
|
-
<tr style="background:gray;text-align:left;">
|
355
|
-
<td colspan="2">this is</td>
|
356
|
-
<td style="background:red;width:200px;">a</td>
|
357
|
-
<td style="vertical-align:top;height:200px;text-align:justify;">row</td>
|
358
|
-
</tr>
|
359
|
-
<tr>
|
360
|
-
<td>this</td>
|
361
|
-
<td style="padding:10px;text-align:justify;">is</td>
|
362
|
-
<td style="vertical-align:top;">another</td>
|
363
|
-
<td class="bob" id="bob">row</td>
|
364
|
-
</tr>
|
365
|
-
</table>
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
<p>An image:</p>
|
370
|
-
|
371
|
-
<p><img src="/common/textist.gif" title="optional alt text" alt="optional alt text" /></p>
|
372
|
-
<ol>
|
373
|
-
<li>Librarians rule</li>
|
374
|
-
<li>Yes they do</li>
|
375
|
-
<li>But you knew that</li>
|
376
|
-
</ol>
|
377
|
-
|
378
|
-
<p>Some more text of dubious character. Here is a noisome string of <span class="caps">CAPITAL</span> letters. Here is something we want to <em>emphasize</em>.
|
379
|
-
That was a linebreak. And something to indicate <strong>strength</strong>. Of course I could use <em>my own <span class="caps">HTML</span> tags</em> if I <strong>felt</strong> like it.</p>
|
380
|
-
|
381
|
-
<h3>Coding</h3>
|
382
|
-
|
383
|
-
<p>This <code>is some code, "isn't it"</code>. Watch those quote marks! Now for some preformatted text:</p>
|
384
|
-
|
385
|
-
|
386
|
-
<pre>
|
387
|
-
<code>
|
388
|
-
$text = str_replace("<p>%::%</p>","",$text);
|
389
|
-
$text = str_replace("%::%</p>","",$text);
|
390
|
-
$text = str_replace("%::%","",$text);
|
391
|
-
|
392
|
-
</code>
|
393
|
-
</pre>
|
394
|
-
<p>This isn’t code.</p>
|
395
|
-
|
396
|
-
<p>So you see, my friends:</p>
|
397
|
-
<ul>
|
398
|
-
<li>The time is now</li>
|
399
|
-
<li>The time is not later</li>
|
400
|
-
<li>The time is not yesterday</li>
|
401
|
-
<li>We must act</li>
|
402
|
-
</ul>
|
403
|
-
|
404
|
-
---
|
405
|
-
in: '"test":http://foo.com/b---ar'
|
406
|
-
out: <p><a href="http://foo.com/b---ar">test</a></p>
|