File: 01-text-trac.t

package info (click to toggle)
libtext-trac-perl 0.15-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 332 kB
  • ctags: 259
  • sloc: perl: 2,935; makefile: 40
file content (427 lines) | stat: -rwxr-xr-x 6,655 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
use strict;
use t::TestTextTrac;

run_tests;

__DATA__
### h1 test
--- input
= heading 1 =
--- expected
<h1 id="heading1">heading 1</h1>

### h2 test<
--- input
== heading 2 ==
--- expected
<h2 id="heading2">heading 2</h2>

### h3 test
--- input
=== heading 3 ===
--- expected
<h3 id="heading3">heading 3</h3>

### h4 test
--- input
==== heading 4 ====
--- expected
<h4 id="heading4">heading 4</h4>

### h5 test
--- input
===== heading 5 =====
--- expected
<h5 id="heading5">heading 5</h5>

### bold test
--- input
'''bold''' '''bold'''
--- expected
<p>
<strong>bold</strong> <strong>bold</strong>
</p>

### italic test
--- input
''italic'' ''italic''
--- expected
<p>
<i>italic</i> <i>italic</i>
</p>

### bolditalic test
--- input
'''''bolditalic''''' '''''bolditalic'''''
--- expected
<p>
<strong><i>bolditalic</i></strong> <strong><i>bolditalic</i></strong>
</p>

### underline test
--- input
__underline__ __underline__
--- expected
<p>
<span class="underline">underline</span> <span class="underline">underline</span>
</p>

### monospace test
--- input
`monospace` {{{monospace}}}
--- expected
<p>
<tt>monospace</tt> <tt>monospace</tt>
</p>

### strike test
--- input
~~strike~~ ~~strike~~
--- expected
<p>
<del>strike</del> <del>strike</del>
</p>

### sup test
--- input
^sup^ ^sup^
--- expected
<p>
<sup>sup</sup> <sup>sup</sup>
</p>

### sub test
--- input
,,sub,, ,,sub,,
--- expected
<p>
<sub>sub</sub> <sub>sub</sub>
</p>

### br test
--- input
line1[[BR]]line2
--- expected
<p>
line1<br />line2
</p>

### p test
--- input
test
test
--- expected
<p>
test
test
</p>

### ul test
--- input
 * list 1-1
 * list 1-2
   * list 2-1
   * list 2-2
--- expected
<ul><li>list 1-1
</li><li>list 1-2
<ul><li>list 2-1
</li><li>list 2-2</li></ul></li></ul>

### ol test
--- input
 1. list 1-1
 1. list 1-2
   a. list a-1
   a. list a-2
--- expected
<ol><li>list 1-1
</li><li>list 1-2
<ol class="loweralpha"><li>list a-1
</li><li>list a-2</li></ol></li></ol>

### blockquote test
--- input
  This text is a quote from someone else.
--- expected
<blockquote>
<p>
  This text is a quote from someone else.
</p>
</blockquote>

### blockquote2 test
--- input
  Ask not what your country can do for you. Ask what you can do for your country.
  
  --John F. Kennedy
--- expected
<blockquote>
<p>
  Ask not what your country can do for you. Ask what you can do for your country.
</p>
<p>
  --John F. Kennedy
</p>
</blockquote>

### pre test
--- input
{{{
  This is pre-formatted text.
  This also pre-formatted text.
}}}
--- expected
<pre class="wiki">
  This is pre-formatted text.
  This also pre-formatted text.
</pre>

### table test
--- input
||Cell 1||Cell 2||Cell 3||
||Cell 4||Cell 5||Cell 6||
--- expected
<table>
<tr><td>Cell 1</td><td>Cell 2</td><td>Cell 3</td></tr>
<tr><td>Cell 4</td><td>Cell 5</td><td>Cell 6</td></tr>
</table>

### hr test
--- input
line1
----
line2
--- expected
<p>
line1
</p>
<hr />
<p>
line2
</p>

### dl test
--- input
 title1::
  content 1-1
  content 1-2
 title2::
  content 2-1
  content 2-2
  content 2-3
--- expected
<dl>
<dt>title1</dt>
<dd>
content 1-1
content 1-2
</dd>
<dt>title2</dt>
<dd>
content 2-1
content 2-2
content 2-3
</dd>
</dl>

### autolink test
--- input
http://mizzy.org/
[http://mizzy.org/ Title]
--- expected
<p>
<a class="ext-link" href="http://mizzy.org/"><span class="icon"></span>http://mizzy.org/</a>
<a class="ext-link" href="http://mizzy.org/"><span class="icon"></span>Title</a>
</p>

### auto image link test
--- input
http://mizzy.org/test.png
[http://mizzy.org/test.png Image]
--- expected
<p>
<a class="ext-link" href="http://mizzy.org/test.png"><span class="icon"></span>http://mizzy.org/test.png</a>
<a class="ext-link" href="http://mizzy.org/test.png"><span class="icon"></span>Image</a>
</p>

### ul node with single space
--- input
 * indent with
 * single space
   * sublist with
   * two spaces
--- expected
<ul><li>indent with
</li><li>single space
<ul><li>sublist with
</li><li>two spaces</li></ul></li></ul>

### ul node with double space
--- input
  * indent with
  * two spaces
    * sublist with
    * two spaces
--- expected
<ul><li>indent with
</li><li>two spaces
<ul><li>sublist with
</li><li>two spaces</li></ul></li></ul>

### ol node with single space
--- input
 1. indent with
 1. single space
   a. sublist with
   a. two spaces
--- expected
<ol><li>indent with
</li><li>single space
<ol class="loweralpha"><li>sublist with
</li><li>two spaces</li></ol></li></ol>

### ol node with double space
--- input
  1. indent with
  1. two spaces
    a. sublist with
    a. two spaces
--- expected
<ol><li>indent with
</li><li>two spaces
<ol class="loweralpha"><li>sublist with
</li><li>two spaces</li></ol></li></ol>

### dl node with single space
--- input
 title1::
   indent title
   single space
 title2::
   indent content
   double space
--- expected
<dl>
<dt>title1</dt>
<dd>
indent title
single space
</dd>
<dt>title2</dt>
<dd>
indent content
double space
</dd>
</dl>

### dl node with double space
--- input
  title1::
    indent title
    double space
  title2::
    indent content
    double space
--- expected
<dl>
<dt>title1</dt>
<dd>
indent title
double space
</dd>
<dt>title2</dt>
<dd>
indent content
double space
</dd>
</dl>

### unknown short link
--- input
unknown:target
--- expected
<p>
unknown:target
</p>

### unknown long link
--- input
[unknown:target label]
--- expected
<p>
[unknown:target label]
</p>

### escape HTML meta-characters
--- input
foo <bar> baz.
foo '''bar''' baz.

 * foo <bar> bar.
 * foo '''bar''' baz.

 1. foo <bar> bar.
 1. foo '''bar''' baz.

||foo||<bar>||'''baz'''||

{{{
foo <bar> baz.
foo '''bar''' baz.
}}}
--- expected
<p>
foo &lt;bar&gt; baz.
foo <strong>bar</strong> baz.
</p>
<ul><li>foo &lt;bar&gt; bar.
</li><li>foo <strong>bar</strong> baz.</li></ul>
<ol><li>foo &lt;bar&gt; bar.
</li><li>foo <strong>bar</strong> baz.</li></ol>
<table>
<tr><td>foo</td><td>&lt;bar&gt;</td><td><strong>baz</strong></td></tr>
</table>
<pre class="wiki">
foo &lt;bar&gt; baz.
foo '''bar''' baz.
</pre>

### citation link
--- input
>> Someone's original text
>> Someone's original text
>> Someone's original text
> Someone else's reply text
> Someone else's reply text
My reply text

>> Someone's original text
My reply text
--- expected
<blockquote class="citation">
<blockquote class="citation">
<p>
 Someone's original text
 Someone's original text
 Someone's original text
</p>
</blockquote>
<p>
 Someone else's reply text
 Someone else's reply text
</p>
</blockquote>
<p>
My reply text
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
 Someone's original text
</p>
</blockquote>
</blockquote>
<p>
My reply text
</p>