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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
Pandoc
Meta { unMeta = fromList [] }
[ Para
[ Str
"This is a set of tests for pandoc Textile Reader. Part of it comes"
, LineBreak
, Str "from John Gruber\8217s markdown test suite."
]
, HorizontalRule
, Header 1 ( "headers" , [] , [] ) [ Str "Headers" ]
, Header
2
( "level-2-with-an-embedded-link" , [] , [] )
[ Str "Level 2 with an "
, Link
( "" , [] , [] )
[ Str "embedded link" ]
( "http://www.example.com" , "" )
]
, Header
3
( "level-3-with-emphasis" , [] , [] )
[ Str "Level 3 with " , Strong [ Str "emphasis" ] ]
, Header 4 ( "level-4" , [] , [] ) [ Str "Level 4" ]
, Header 5 ( "level-5" , [] , [] ) [ Str "Level 5" ]
, Header 6 ( "level-6" , [] , [] ) [ Str "Level 6" ]
, Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ]
, Para [ Str "Here\8217s a regular paragraph." ]
, Para
[ Str
"Line breaks are preserved in textile, so you can not wrap your very"
, LineBreak
, Str
"long paragraph with your favourite text editor and have it rendered"
, LineBreak
, Str "with no break."
]
, Para [ Str "Here\8217s one with a bullet." ]
, BulletList [ [ Plain [ Str "criminey." ] ] ]
, Para
[ Str "There should be a paragraph break between here" ]
, Para [ Str "and here." ]
, Para [ Str "pandoc converts textile." ]
, Header
1 ( "block-quotes" , [] , [] ) [ Str "Block Quotes" ]
, BlockQuote
[ Para
[ Str
"This is a famous quote from somebody. He had a lot of things to"
, LineBreak
, Str
"say, so the text is really really long and spans on multiple lines."
]
]
, Para [ Str "And a following paragraph." ]
, Header 1 ( "code-blocks" , [] , [] ) [ Str "Code Blocks" ]
, Para [ Str "Code:" ]
, CodeBlock
( "" , [] , [] )
" ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab"
, Para [ Str "And:" ]
, CodeBlock
( "" , [] , [] )
" this code block is indented by two tabs\n\n These should not be escaped: \\$ \\\\ \\> \\[ \\{"
, CodeBlock
( "" , [] , [] )
"Code block with .bc\n continued\n @</\\"
, CodeBlock
( "" , [] , [] ) "extended code block\n\n continued"
, Para [ Str "ended by paragraph" ]
, Para
[ Str "Inline code: "
, Code ( "" , [] , [] ) "<tt>"
, Str ", "
, Code ( "" , [] , [] ) "@"
, Str "."
]
, Header 1 ( "notextile" , [] , [] ) [ Str "Notextile" ]
, Para
[ Str "A block of text can be protected with notextile :" ]
, Para [ Str "\nNo *bold* and\n* no bullet\n" ]
, Para
[ Str
"and inlines can be protected with double *equals (=)* markup."
]
, Header 1 ( "lists" , [] , [] ) [ Str "Lists" ]
, Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ]
, Para [ Str "Asterisks tight:" ]
, BulletList
[ [ Plain [ Str "asterisk 1" ] ]
, [ Plain [ Str "asterisk 2" ] ]
, [ Plain [ Str "asterisk 3" ] ]
]
, Para [ Str "With line breaks:" ]
, BulletList
[ [ Plain [ Str "asterisk 1" , LineBreak , Str "newline" ] ]
, [ Plain [ Str "asterisk 2" ] ]
]
, Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ]
, Para [ Str "Tight:" ]
, OrderedList
( 1 , DefaultStyle , DefaultDelim )
[ [ Plain [ Str "First" ] ]
, [ Plain [ Str "Second" ] ]
, [ Plain [ Str "Third" ] ]
]
, Header 2 ( "nested" , [] , [] ) [ Str "Nested" ]
, BulletList
[ [ Plain [ Str "ui 1" ]
, BulletList
[ [ Plain [ Str "ui 1.1" ]
, OrderedList
( 1 , DefaultStyle , DefaultDelim )
[ [ Plain [ Str "oi 1.1.1" ] ]
, [ Plain [ Str "oi 1.1.2" ] ]
]
]
, [ Plain [ Str "ui 1.2" ] ]
]
]
, [ Plain [ Str "ui 2" ]
, OrderedList
( 1 , DefaultStyle , DefaultDelim )
[ [ Plain [ Str "oi 2.1" ]
, BulletList
[ [ Plain [ Str "ui 2.1.1" ] ]
, [ Plain [ Str "ui 2.1.2" ] ]
]
]
]
]
]
, Header 2 ( "issue-1500" , [] , [] ) [ Str "Issue #1500" ]
, BulletList
[ [ Plain [ Str "one" ] ]
, [ Plain [ Str "two" , LineBreak , Str "-> and more" ] ]
]
, Header 2 ( "issue-1513" , [] , [] ) [ Str "Issue #1513" ]
, Para [ Str "List:" ]
, BulletList
[ [ Plain [ Str "one" ] ] , [ Plain [ Str "two" ] ] ]
, Header
2 ( "definition-list" , [] , [] ) [ Str "Definition List" ]
, DefinitionList
[ ( [ Str "coffee" ]
, [ [ Plain [ Str "Hot and black" ] ] ]
)
, ( [ Str "tea" ]
, [ [ Plain [ Str "Also hot, but a little less black" ] ] ]
)
, ( [ Str "milk" ]
, [ [ Para [ Str "Nourishing beverage for baby cows." ]
, Para [ Str "Cold drink that goes great with cookies." ]
]
]
)
, ( [ Str "beer" ]
, [ [ Plain [ Str "fresh and bitter" ] ] ]
)
]
, Header
1 ( "inline-markup" , [] , [] ) [ Str "Inline Markup" ]
, Para
[ Str "This is "
, Emph [ Str "emphasized" ]
, Str ", and so "
, Emph [ Str "is this" ]
, Str "."
, LineBreak
, Str "This is "
, Strong [ Str "strong" ]
, Str ", and so "
, Strong [ Str "is this" ]
, Str "."
, LineBreak
, Str "This is "
, Underline [ Str "inserted" ]
, Str ", and this is "
, Strikeout [ Str "deleted" ]
, Str "."
, LineBreak
, Str
"Hyphenated-words-are-ok, as well as strange_underscore_notation."
, LineBreak
, Str "A "
, Link
( "" , [] , [] )
[ Strong [ Str "strong link" ] ]
( "http://www.foobar.com" , "" )
, Str "."
]
, Para
[ Emph [ Strong [ Str "This is strong and em." ] ]
, LineBreak
, Str "So is "
, Strong [ Emph [ Str "this" ] ]
, Str " word and "
, Emph [ Strong [ Str "that one" ] ]
, Str "."
, LineBreak
, Strikeout
[ Str "This is strikeout and " , Strong [ Str "strong" ] ]
]
, Para
[ Str "Superscripts: a"
, Superscript [ Str "bc" ]
, Str "d a "
, Superscript [ Strong [ Str "hello" ] ]
, Str " a"
, Superscript [ Str "hello there" ]
, Str "."
, LineBreak
, Str "Subscripts: "
, Subscript [ Str "here" ]
, Str " H "
, Subscript [ Str "2" ]
, Str "O, H "
, Subscript [ Str "23" ]
, Str "O, H "
, Subscript [ Str "many of them" ]
, Str "O."
]
, Para [ Str "Dashes : How cool \8212 automatic dashes." ]
, Para
[ Str
"Ellipses : He thought and thought \8230 and then thought some more."
]
, Para
[ Str "Quotes and apostrophes : "
, Quoted DoubleQuote [ Str "I\8217d like to thank you" ]
, Str " for example."
]
, Header 1 ( "links" , [] , [] ) [ Str "Links" ]
, Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ]
, Para
[ Str "Just a "
, Link
( "" , [] , [] ) [ Str "url" ] ( "http://www.url.com" , "" )
]
, Para
[ Link
( "" , [] , [] )
[ Str "Email link" ]
( "mailto:[email protected]" , "" )
]
, Para
[ Quoted DoubleQuote [ Str "not a link" ] , Str ": foo" ]
, Para
[ Str "Automatic linking to "
, Link
( "" , [] , [] )
[ Str "http://www.example.com" ]
( "http://www.example.com" , "" )
, Str "."
]
, Para
[ Link
( "" , [] , [] )
[ Str "Example" ]
( "http://www.example.com/" , "" )
, Str ": Example of a link followed by a colon."
]
, Para
[ Str "A link"
, Link
( "" , [] , [] )
[ Str "with brackets" ]
( "http://www.example.com" , "" )
, Str "and no spaces."
]
, Header 1 ( "tables" , [] , [] ) [ Str "Tables" ]
, Para
[ Str "Textile allows tables with and without headers :" ]
, Header
2 ( "without-headers" , [] , [] ) [ Str "Without headers" ]
, Table
( "" , [] , [] )
(Caption Nothing [])
[ ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
]
(TableHead ( "" , [] , [] ) [])
[ TableBody
( "" , [] , [] )
(RowHeadColumns 0)
[]
[ Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "name" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "age" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "sex" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "joan" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "24" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "f" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "archie" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "29" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "m" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "bella" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "45" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "f" ] ]
]
]
]
(TableFoot ( "" , [] , [] ) [])
, Para [ Str "and some text following \8230" ]
, Header
2 ( "with-headers" , [] , [] ) [ Str "With headers" ]
, Table
( "" , [] , [] )
(Caption Nothing [])
[ ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
]
(TableHead
( "" , [] , [] )
[ Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "name" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "age" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "sex" ] ]
]
])
[ TableBody
( "" , [] , [] )
(RowHeadColumns 0)
[]
[ Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "joan" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "24" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "f" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "archie" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "29" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "m" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "bella" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "45" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "f" ] ]
]
]
]
(TableFoot ( "" , [] , [] ) [])
, Header 1 ( "images" , [] , [] ) [ Str "Images" ]
, Para
[ Str "Textile inline image syntax, like"
, LineBreak
, Str "here "
, Image
( "" , [] , [] )
[ Str "this is the alt text" ]
( "this_is_an_image.png" , "this is the alt text" )
, LineBreak
, Str "and here "
, Image
( "" , [] , [] ) [ Str "" ] ( "this_is_an_image.png" , "" )
, Str "."
]
, Header 1 ( "attributes" , [] , [] ) [ Str "Attributes" ]
, Header
2
( "ident"
, [ "bar" , "foo" ]
, [ ( "style" , "color:red;" ) , ( "lang" , "en" ) ]
)
[ Str "HTML and CSS attributes are parsed in headers." ]
, Header
2
( "centered" , [] , [ ( "style" , "text-align:center;" ) ] )
[ Str "Centered" ]
, Header
2
( "right" , [] , [ ( "style" , "text-align:right;" ) ] )
[ Str "Right" ]
, Header
2
( "justified"
, []
, [ ( "lang" , "en" )
, ( "style" , "color:blue;text-align:justify;" )
]
)
[ Str "Justified" ]
, Para
[ Str "as well as "
, Strong
[ Span ( "" , [ "foo" ] , [] ) [ Str "inline attributes" ] ]
, Str " of "
, Span
( "" , [] , [ ( "style" , "color:red;" ) ] )
[ Str "all kind" ]
]
, Para
[ Str "and paragraph attributes, and table attributes." ]
, Table
( "" , [] , [] )
(Caption Nothing [])
[ ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
]
(TableHead ( "" , [] , [] ) [])
[ TableBody
( "" , [] , [] )
(RowHeadColumns 0)
[]
[ Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "name" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "age" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "sex" ] ]
]
, Row
( "" , [] , [] )
[ Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "joan" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "24" ] ]
, Cell
( "" , [] , [] )
AlignDefault
(RowSpan 1)
(ColSpan 1)
[ Plain [ Str "f" ] ]
]
]
]
(TableFoot ( "" , [] , [] ) [])
, Para [ Emph [ Str "(class#id) emph" ] ]
, Para [ Emph [ Str "(no class#id) emph" ] ]
, Header 1 ( "entities" , [] , [] ) [ Str "Entities" ]
, Para [ Str "*" , LineBreak , Str "&" ]
, Header 1 ( "raw-html" , [] , [] ) [ Str "Raw HTML" ]
, Para
[ Str "However, "
, RawInline (Format "html") "<strong>"
, Str " raw HTML inlines "
, RawInline (Format "html") "</strong>"
, Str " are accepted, as well as :"
]
, RawBlock (Format "html") "<div class=\"foobar\">"
, Para
[ Str "any "
, Strong [ Str "Raw HTML Block" ]
, Str " with bold"
]
, RawBlock (Format "html") "</div>"
, Para [ Str "Html blocks can" ]
, RawBlock (Format "html") "<div>"
, Para [ Str "interrupt paragraphs" ]
, RawBlock (Format "html") "</div>"
, Para [ Str "as well." ]
, Para [ Str "Can you prove that 2 < 3 ?" ]
, Header
1
( "acronyms-and-marks" , [] , [] )
[ Str "Acronyms and marks" ]
, Para [ Str "PBS (Public Broadcasting System)" ]
, Para [ Str "Hi\8482" ]
, Para [ Str "Hi \8482" ]
, Para [ Str "\174 Hi\174" ]
, Para [ Str "Hi\169\&2008 \169 2008" ]
, Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ]
, Para
[ Str "A note."
, Note
[ Para [ Str "The note" , LineBreak , Str "is here!" ] ]
, Str " Another note"
, Note [ Para [ Str "Other note." ] ]
, Str "."
]
, Header
1 ( "comment-blocks" , [] , [] ) [ Str "Comment blocks" ]
, Para [ Str "not a comment." ]
]
|