BBRedCloth 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. data/BBRedCloth.gemspec +36 -0
  2. data/CHANGELOG +123 -0
  3. data/COPYING +18 -0
  4. data/Manifest +45 -0
  5. data/README.textile +149 -0
  6. data/Rakefile +247 -0
  7. data/bin/bbredcloth +34 -0
  8. data/ext/mingw-rbconfig.rb +176 -0
  9. data/ext/redcloth_scan/extconf.rb +9 -0
  10. data/ext/redcloth_scan/redcloth.h +196 -0
  11. data/ext/redcloth_scan/redcloth_attributes.c +655 -0
  12. data/ext/redcloth_scan/redcloth_bbcode.c +2457 -0
  13. data/ext/redcloth_scan/redcloth_bbcode_inline.c +1890 -0
  14. data/ext/redcloth_scan/redcloth_inline.c +12387 -0
  15. data/ext/redcloth_scan/redcloth_scan.c +10848 -0
  16. data/extras/ragel_profiler.rb +73 -0
  17. data/lib/case_sensitive_require/RedCloth.rb +6 -0
  18. data/lib/redcloth/erb_extension.rb +27 -0
  19. data/lib/redcloth/formatters/base.rb +57 -0
  20. data/lib/redcloth/formatters/html.rb +487 -0
  21. data/lib/redcloth/formatters/latex.rb +249 -0
  22. data/lib/redcloth/formatters/latex_entities.yml +2414 -0
  23. data/lib/redcloth/textile_doc.rb +196 -0
  24. data/lib/redcloth/version.rb +28 -0
  25. data/lib/redcloth.rb +37 -0
  26. data/setup.rb +1585 -0
  27. data/test/basic.yml +933 -0
  28. data/test/code.yml +229 -0
  29. data/test/definitions.yml +82 -0
  30. data/test/extra_whitespace.yml +64 -0
  31. data/test/filter_html.yml +177 -0
  32. data/test/filter_pba.yml +20 -0
  33. data/test/helper.rb +109 -0
  34. data/test/html.yml +313 -0
  35. data/test/images.yml +254 -0
  36. data/test/instiki.yml +38 -0
  37. data/test/links.yml +275 -0
  38. data/test/lists.yml +283 -0
  39. data/test/poignant.yml +89 -0
  40. data/test/sanitize_html.yml +42 -0
  41. data/test/table.yml +267 -0
  42. data/test/test_custom_tags.rb +46 -0
  43. data/test/test_erb.rb +13 -0
  44. data/test/test_extensions.rb +31 -0
  45. data/test/test_formatters.rb +24 -0
  46. data/test/test_parser.rb +73 -0
  47. data/test/test_restrictions.rb +61 -0
  48. data/test/textism.yml +484 -0
  49. data/test/threshold.yml +772 -0
  50. data/test/validate_fixtures.rb +74 -0
  51. metadata +139 -0
data/test/basic.yml ADDED
@@ -0,0 +1,933 @@
1
+ ---
2
+ name: paragraphs
3
+ desc: Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph.
4
+ in: |-
5
+ A single paragraph.
6
+
7
+ Followed by another.
8
+ html: |-
9
+ <p>A single paragraph.</p>
10
+ <p>Followed by another.</p>
11
+ ---
12
+ name: block containing block start
13
+ in: |-
14
+ I saw a ship. It ate my elephant.
15
+ html: |-
16
+ <p>I saw a ship. It ate my elephant.</p>
17
+ ---
18
+ name: extended block containing block start
19
+ in: |-
20
+ p.. I saw a ship. It ate my elephant.
21
+
22
+ When the elephant comes to take a p. you...
23
+ html: |-
24
+ <p>I saw a ship. It ate my elephant.</p>
25
+ <p>When the elephant comes to take a p. you&#8230;</p>
26
+ ---
27
+ name: blockquote containing block start
28
+ in: |-
29
+ bq. I saw a ship. It ate my elephant.
30
+ html: |-
31
+ <blockquote>
32
+ <p>I saw a ship. It ate my elephant.</p>
33
+ </blockquote>
34
+ ---
35
+ name: extended blockquote containing block start
36
+ in: |-
37
+ bq.. I saw a ship. It ate my elephant.
38
+
39
+ When the elephant comes to take a p. you...
40
+ html: |-
41
+ <blockquote>
42
+ <p>I saw a ship. It ate my elephant.</p>
43
+ <p>When the elephant comes to take a p. you&#8230;</p>
44
+ </blockquote>
45
+ ---
46
+ name: notextile block containing block start
47
+ in: |-
48
+ notextile. I saw a ship. It ate my elephant.
49
+ html: |-
50
+ I saw a ship. It ate my elephant.
51
+ valid_html: false
52
+ ---
53
+ name: extended notextile block containing block start
54
+ in: |-
55
+ notextile.. I saw a ship. It ate my elephant.
56
+
57
+ When the elephant comes to take a p. you...
58
+ html: |-
59
+ I saw a ship. It ate my elephant.
60
+
61
+ When the elephant comes to take a p. you...
62
+ valid_html: false
63
+ ---
64
+ name: pre block containing block start
65
+ in: |-
66
+ pre. I saw a ship. It ate my elephant.
67
+ html: |-
68
+ <pre>I saw a ship. It ate my elephant.</pre>
69
+ ---
70
+ name: extended pre block containing block start
71
+ in: |-
72
+ pre.. I saw a ship. It ate my elephant.
73
+
74
+ When the elephant comes to take a p. you...
75
+ html: |-
76
+ <pre>I saw a ship. It ate my elephant.</pre>
77
+ <pre>When the elephant comes to take a p. you...</pre>
78
+ ---
79
+ name: html tags
80
+ desc: You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it&#8217;s found in a <code>pre</code> or <code>code</code> block.
81
+ in: |-
82
+ I am <b>very</b> serious.
83
+
84
+ <pre>
85
+ I am <b>very</b> serious.
86
+ </pre>
87
+ html: |-
88
+ <p>I am <b>very</b> serious.</p>
89
+ <pre>
90
+ I am &lt;b&gt;very&lt;/b&gt; serious.
91
+ </pre>
92
+ ---
93
+ name: line breaks
94
+ desc: Line breaks are converted to HTML breaks.
95
+ in: |-
96
+ I spoke.
97
+ And none replied.
98
+ html: |-
99
+ <p>I spoke.<br />
100
+ And none replied.</p>
101
+ html_no_breaks: |-
102
+ <p>I spoke.
103
+ And none replied.</p>
104
+ lite_mode_html: |-
105
+ I spoke.<br />
106
+ And none replied.
107
+ ---
108
+ name: curly quotes
109
+ desc: Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye.
110
+ in: "\"Observe!\""
111
+ html: <p>&#8220;Observe!&#8221;</p>
112
+ ---
113
+ name: quotes contained in multi-paragraph quotes
114
+ in: |-
115
+ "I first learned about this thing called "Redcloth" several years ago.
116
+
117
+ "It's wonderful."
118
+ html: |-
119
+ <p>&#8220;I first learned about this thing called &#8220;Redcloth&#8221; several years ago.</p>
120
+ <p>&#8220;It&#8217;s wonderful.&#8221;</p>
121
+ ---
122
+ name: double hyphens
123
+ desc: Double hyphens are replaced with an em-dash.
124
+ in: Observe--very nice!
125
+ html: <p>Observe&#8212;very nice!</p>
126
+ latex: "Observe---very nice!\n\n"
127
+ ---
128
+ name: double hyphens with spaces
129
+ desc: Double hyphens are replaced with an em-dash and surrounding spaces are preserved.
130
+ in: Observe -- very nice!
131
+ html: <p>Observe &#8212; very nice!</p>
132
+ latex: "Observe --- very nice!\n\n"
133
+ ---
134
+ name: parenthetical phrase set off with em dashes
135
+ desc: Sentences with two em dashes should not turn them into strikethroughs
136
+ in: An emdash indicates a parenthetical thought--like this one--which is set apart from the rest of a sentence.
137
+ html: "<p>An emdash indicates a parenthetical thought&#8212;like this one&#8212;which is set apart from the rest of a sentence.</p>"
138
+ latex: "An emdash indicates a parenthetical thought---like this one---which is set apart from the rest of a sentence.\n\n"
139
+ ---
140
+ name: parenthetical phrase set off with em dashes surrounded by spaces
141
+ desc: Sentences with two em dashes should not turn them into strikethroughs
142
+ in: An emdash indicates a parenthetical thought -- like this one -- which is set apart from the rest of a sentence.
143
+ html: "<p>An emdash indicates a parenthetical thought &#8212; like this one &#8212; which is set apart from the rest of a sentence.</p>"
144
+ latex: "An emdash indicates a parenthetical thought --- like this one --- which is set apart from the rest of a sentence.\n\n"
145
+ ---
146
+ name: single hyphens with spaces
147
+ desc: Single hyphens are replaced with en-dashes if they are surrounded by spaces.
148
+ in: Observe - tiny and brief.
149
+ html: <p>Observe &#8211; tiny and brief.</p>
150
+ latex: "Observe--tiny and brief.\n\n"
151
+ ---
152
+ name: midword hyphens
153
+ desc: Single hyphens are left alone if not surrounded by spaces.
154
+ in: Observe the nicely-done hyphen.
155
+ html: <p>Observe the nicely-done hyphen.</p>
156
+ ---
157
+ name: ellipses
158
+ desc: Triplets of periods become an ellipsis.
159
+ in: Observe...
160
+ html: <p>Observe&#8230;</p>
161
+ lite_mode_html: Observe&#8230;
162
+ ---
163
+ name: dimension sign
164
+ desc: The letter 'x' becomes a dimension sign when used between digits.
165
+ in: "Observe: 2x3."
166
+ html: "<p>Observe: 2&#215;3.</p>"
167
+ ---
168
+ name: dimension sign with space after
169
+ in: "The room is 2x3 inches big."
170
+ html: "<p>The room is 2&#215;3 inches big.</p>"
171
+ ---
172
+ name: dimension sign with spaces
173
+ in: "Observe: 2 x 4."
174
+ html: "<p>Observe: 2 &#215; 4.</p>"
175
+ ---
176
+ name: dimension signs chained
177
+ in: "Observe: 2x3x4."
178
+ html: "<p>Observe: 2&#215;3&#215;4.</p>"
179
+ lite_mode_html: "Observe: 2&#215;3&#215;4."
180
+ ---
181
+ name: dimension signs with double primes
182
+ in: 'My mouse: 2.5" x 4".'
183
+ html: '<p>My mouse: 2.5&#8243; &#215; 4&#8243;.</p>'
184
+ ---
185
+ name: dimension signs with single primes
186
+ in: "My office: 5' x 4.5'."
187
+ html: "<p>My office: 5&#8242; &#215; 4.5&#8242;.</p>"
188
+ ---
189
+ name: trademark and copyright
190
+ desc: Conversion of trademark and copyright symbols.
191
+ in: one(TM), two(R), three(C).
192
+ html: <p>one&#8482;, two&#174;, three&#169;.</p>
193
+ lite_mode_html: one&#8482;, two&#174;, three&#169;.
194
+ ---
195
+ name: headers
196
+ desc: To make an entire paragraph into a Header, place “h<em>n</em>.” at its beginning, where <em>n</em> is a number from 1-6.
197
+ in: h3. Header 3
198
+ html: <h3>Header 3</h3>
199
+ ---
200
+ name: blockquote
201
+ desc: To make an entire paragraph into a block quotation, place “bq.” before it.
202
+ in: |-
203
+ Any old text
204
+
205
+ bq. A block quotation.
206
+
207
+ Any old text
208
+ html: |-
209
+ <p>Any old text</p>
210
+ <blockquote>
211
+ <p>A block quotation.</p>
212
+ </blockquote>
213
+ <p>Any old text</p>
214
+ ---
215
+ name: footnote reference
216
+ desc: Numeric references within text to footnotes appear between square brackets.
217
+ in: This is covered elsewhere[1].
218
+ html: <p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p>
219
+ ---
220
+ name: footnote
221
+ desc: To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote&#8217;s number, followed by a dot and a space.
222
+ in: fn1. Down here, in fact.
223
+ html: <p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p>
224
+ ---
225
+ name: em
226
+ desc: Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as <em>italics</em>.
227
+ in: I _believe_ every word.
228
+ html: <p>I <em>believe</em> every word.</p>
229
+ lite_mode_html: "I <em>believe</em> every word."
230
+ ---
231
+ name: strong
232
+ desc: Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as <strong>bold</strong>.
233
+ in: And then? She *fell*!
234
+ html: <p>And then? She <strong>fell</strong>!</p>
235
+ lite_mode_html: "And then? She <strong>fell</strong>!"
236
+ general_disable_inline: <p>And then? She *fell*!</p>
237
+ ---
238
+ name: strong phrase beginning with a number
239
+ desc: A strong phrase at the beginning of a line that begins with a number should not be recognized as a ul with a start value (no such thing)
240
+ in: "*10 times as many*"
241
+ html: "<p><strong>10 times as many</strong></p>"
242
+ ---
243
+ name: force bold italics
244
+ desc: Both italics and bold can be forced by doubling the underscores or asterisks.
245
+ in: |-
246
+ I __know__.
247
+ I **really** __know__.
248
+ html: |-
249
+ <p>I <i>know</i>.<br />
250
+ I <b>really</b> <i>know</i>.</p>
251
+ ---
252
+ name: citation
253
+ desc: Use double question marks to indicate <em>citation</em>. The title of a book, for instance.
254
+ in: ??Cat's Cradle?? by Vonnegut
255
+ html: <p><cite>Cat&#8217;s Cradle</cite> by Vonnegut</p>
256
+ ---
257
+ name: code phrases
258
+ desc: Code phrases can be surrounded by at-symbols.
259
+ in: Convert with @r.to_html@
260
+ html: <p>Convert with <code>r.to_html</code></p>
261
+ lite_mode_html: Convert with <code>r.to_html</code>
262
+ ---
263
+ name: code phrases not created with multiple email addresses
264
+ in: Please email why@domain.com or jason@domain.com.
265
+ html: <p>Please email why@domain.com or jason@domain.com.</p>
266
+ ---
267
+ name: del
268
+ desc: To indicate a passage which has been deleted, surround the passage with hypens.
269
+ in: I'm -sure- not sure.
270
+ html: <p>I&#8217;m <del>sure</del> not sure.</p>
271
+ general_disable_inline: <p>I&#8217;m -sure- not sure.</p>
272
+ ---
273
+ name: ins
274
+ desc: Pluses around a passage indicate its insertion.
275
+ in: You are a +pleasant+ child.
276
+ html: <p>You are a <ins>pleasant</ins> child.</p>
277
+ ---
278
+ name: superscript
279
+ desc: To superscript a phrase, surround with carets.
280
+ in: a ^2^ + b ^2^ = c ^2^
281
+ html: <p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p>
282
+ ---
283
+ name: parenthetical superscript phrase
284
+ in: '^(image courtesy NASA)^'
285
+ html: '<p><sup>(image courtesy <span class="caps">NASA</span>)</sup></p>'
286
+ ---
287
+ name: subscript
288
+ desc: To subscript, surround with tildes.
289
+ in: log ~2~ x
290
+ html: <p>log <sub>2</sub> x</p>
291
+ ---
292
+ name: parenthetical subscript phrase
293
+ in: '~(image courtesy NASA)~'
294
+ html: '<p><sub>(image courtesy <span class="caps">NASA</span>)</sub></p>'
295
+ ---
296
+ name: tight superscript and subscript
297
+ desc: if you want your superscript or subscript to not be surrounded by spaces, you must use square brackets
298
+ in: f(x, n) = log[~4~]x[^n^]
299
+ html: '<p>f(x, n) = log<sub>4</sub>x<sup>n</sup></p>'
300
+ ---
301
+ name: span
302
+ desc: Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span.
303
+ in: I'm %unaware% of most soft drinks.
304
+ html: <p>I&#8217;m <span>unaware</span> of most soft drinks.</p>
305
+ ---
306
+ name: style span
307
+ desc: This way, you can apply style settings, as described in the next section to arbitrary phrases.
308
+ in: |-
309
+ I'm %{color:red}unaware%
310
+ of most soft drinks.
311
+ html: |-
312
+ <p>I&#8217;m <span style="color:red;">unaware</span><br />
313
+ of most soft drinks.</p>
314
+ lite_mode_html: |-
315
+ I&#8217;m <span style="color:red;">unaware</span><br />
316
+ of most soft drinks.
317
+ ---
318
+ name: percent sign
319
+ desc: though percent signs indicate a span, they shouldn't be overly greedy.
320
+ # EDITED FOR AUTOLINKING
321
+ in: |-
322
+ http://blah.com/one%20two%20three
323
+ (min)5%-95%(max)
324
+ html: |-
325
+ <p><a href="http://blah.com/one%20two%20three">http://blah.com/one%20two%20three</a><br />
326
+ (min)5%-95%(max)</p>
327
+ ---
328
+ name: css class
329
+ desc: A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block.
330
+ in: p(example1). An example
331
+ html: <p class="example1">An example</p>
332
+ ---
333
+ name: css id
334
+ desc: An element ID can be given by prefixing the ID with a pound symbol and using it in place of the class.
335
+ in: p(#big-red). Red here
336
+ html: <p id="big-red">Red here</p>
337
+ ---
338
+ name: class and id combined
339
+ desc: Class and ID can be combined by placing the class first.
340
+ in: p(example1#big-red2). Red here
341
+ html: <p class="example1" id="big-red2">Red here</p>
342
+ ---
343
+ name: css style
344
+ desc: Style settings can be provided directly by surrounding them in curly braces.
345
+ in: p{color:blue;margin:30px}. Spacey blue
346
+ html: <p style="color:blue;margin:30px;">Spacey blue</p>
347
+ ---
348
+ name: language designations
349
+ desc: Language designations can be given between angel brackets.
350
+ in: p[fr]. rouge
351
+ html: <p lang="fr">rouge</p>
352
+ ---
353
+ name: block attributes on phrase modifiers
354
+ desc: All block attributes can be applied to phrases as well by placing them just inside the opening modifier.
355
+ in: |-
356
+ I seriously *{color:red}blushed*
357
+ when I _(big)sprouted_ that
358
+ corn stalk from my
359
+ %[es]cabeza%.
360
+ html: |-
361
+ <p>I seriously <strong style="color:red;">blushed</strong><br />
362
+ when I <em class="big">sprouted</em> that<br />
363
+ corn stalk from my<br />
364
+ <span lang="es">cabeza</span>.</p>
365
+ general_disable_inline: |-
366
+ <p>I seriously *{color:red}blushed*<br />
367
+ when I <em class="big">sprouted</em> that<br />
368
+ corn stalk from my<br />
369
+ <span lang="es">cabeza</span>.</p>
370
+ ---
371
+ name: inline attributes preceded by text are treated as literal
372
+ desc: modifiers must come first, without anything before them
373
+ in: |-
374
+ I *seriously {color:red}blushed*
375
+ when I _first (big)sprouted_ that
376
+ corn stalk from my
377
+ %grande [es]cabeza%.
378
+ html: |-
379
+ <p>I <strong>seriously {color:red}blushed</strong><br />
380
+ when I <em>first (big)sprouted</em> that<br />
381
+ corn stalk from my<br />
382
+ <span>grande [es]cabeza</span>.</p>
383
+ general_disable_inline: |-
384
+ <p>I *seriously {color:red}blushed*<br />
385
+ when I <em>first (big)sprouted</em> that<br />
386
+ corn stalk from my<br />
387
+ <span>grande [es]cabeza</span>.</p>
388
+ ---
389
+ name: align justified
390
+ desc: Text inside blocks can be aligned in four basic ways.
391
+ in: p<>. justified
392
+ html: <p style="text-align:justify;">justified</p>
393
+ ---
394
+ name: indentation
395
+ desc: Indentation can also be specified by provide a single left paren for every 1em to the left. A single right paren for every 1em to the right.
396
+ in: p))). right ident 3em
397
+ html: <p style="padding-right:3em;">right ident 3em</p>
398
+ ---
399
+ name: indentation and alignment
400
+ desc: Identation may be coupled with alignment.
401
+ in: h2()>. Bingo.
402
+ html: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2>
403
+ ---
404
+ name: many modifiers combined
405
+ desc: And, furthermore, coupled with language settings and CSS styles.
406
+ in: h3()>[no]{color:red}. Bingo
407
+ html: <h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3>
408
+ ---
409
+ name: code blocks
410
+ desc: For example, long code blocks belong between <code>pre</code> and <code>code</code> tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents.
411
+ in: |
412
+ <pre>
413
+ <code>
414
+ a.gsub!( /</, '' )
415
+ </code>
416
+ </pre>
417
+ html: |-
418
+ <pre>
419
+ <code>
420
+ a.gsub!( /&lt;/, '' )
421
+ </code>
422
+ </pre>
423
+ ---
424
+ name: div tags
425
+ desc: You may also choose to surround sections with <code>div</code> tags to separate your document into sections. <a href="http://www.instiki.org/">Instiki</a> uses this technique to float a sidebar to the right.
426
+ in: |
427
+ <div style="float:right;">
428
+
429
+ h3. Sidebar
430
+
431
+ "Hobix":http://hobix.com/
432
+ "Ruby":http://ruby-lang.org/
433
+
434
+ </div>
435
+
436
+ The main text of the page goes here and will stay to the left of the sidebar.
437
+ html: |-
438
+ <div style="float:right;">
439
+ <h3>Sidebar</h3>
440
+ <p><a href="http://hobix.com/">Hobix</a><br />
441
+ <a href="http://ruby-lang.org/">Ruby</a></p>
442
+ </div>
443
+ <p>The main text of the page goes here and will stay to the left of the sidebar.</p>
444
+ ---
445
+ name: numbered list
446
+ desc: To make a numbered list, place each item in its own paragraph, preceded by &#8221;#&#8221;.
447
+ in: |-
448
+ # A first item
449
+ # A second item
450
+ # A third
451
+ html: |-
452
+ <ol>
453
+ <li>A first item</li>
454
+ <li>A second item</li>
455
+ <li>A third</li>
456
+ </ol>
457
+ ---
458
+ name: nested numbered lists
459
+ desc: These lists may be nested by increasing the number of pound symbols preceding child entries.
460
+ in: |-
461
+ # Fuel could be:
462
+ ## Coal
463
+ ## Gasoline
464
+ ## Electricity
465
+ # Humans need only:
466
+ ## Water
467
+ ## Protein
468
+ html: |-
469
+ <ol>
470
+ <li>Fuel could be:
471
+ <ol>
472
+ <li>Coal</li>
473
+ <li>Gasoline</li>
474
+ <li>Electricity</li>
475
+ </ol></li>
476
+ <li>Humans need only:
477
+ <ol>
478
+ <li>Water</li>
479
+ <li>Protein</li>
480
+ </ol></li>
481
+ </ol>
482
+ ---
483
+ name: bulleted list
484
+ desc: Bulleted lists use an asterisk in place of the pound.
485
+ in: |-
486
+ * A first item
487
+ * A second item
488
+ * A third
489
+ html: |-
490
+ <ul>
491
+ <li>A first item</li>
492
+ <li>A second item</li>
493
+ <li>A third</li>
494
+ </ul>
495
+ ---
496
+ name: nested bulleted lists
497
+ desc: These lists may be nested in like manner.
498
+ in: |-
499
+ * Fuel could be:
500
+ ** Coal
501
+ ** Gasoline
502
+ ** Electricity
503
+ * Humans need only:
504
+ ** Water
505
+ ** Protein
506
+ html: |-
507
+ <ul>
508
+ <li>Fuel could be:
509
+ <ul>
510
+ <li>Coal</li>
511
+ <li>Gasoline</li>
512
+ <li>Electricity</li>
513
+ </ul></li>
514
+ <li>Humans need only:
515
+ <ul>
516
+ <li>Water</li>
517
+ <li>Protein</li>
518
+ </ul></li>
519
+ </ul>
520
+ ---
521
+ name: links
522
+ desc: Basic links are comprised of a phrase which is linked to a <acronym title="Universal Resource Locator">URL</acronym>. Place the descriptive phrase in quotation marks. Follow it immediately by a colon and the URL.
523
+ in: I searched "Google":http://google.com.
524
+ html: <p>I searched <a href="http://google.com">Google</a>.</p>
525
+ lite_mode_html: I searched <a href="http://google.com">Google</a>.
526
+ ---
527
+ #name: link aliases
528
+ #desc: If you are using the same link several times in your document, or you’d just like to be a tad more organized, you can use a link alias. Place the URL anywhere in your document, beginning with its alias in square brackets. Then, use the alias in place of the URL, using the link format above.
529
+ #in: |-
530
+ # I am crazy about "Hobix":hobix
531
+ # and "it's":hobix "all":hobix I ever
532
+ # "link to":hobix!
533
+ #
534
+ # [hobix]http://hobix.com
535
+ #html: |-
536
+ # <p>I am crazy about <a href="http://hobix.com">Hobix</a><br />
537
+ # and <a href="http://hobix.com">it&#8217;s</a> <a href="http://hobix.com">all</a> I ever<br />
538
+ # <a href="http://hobix.com">link to</a>!</p>
539
+ #---
540
+ name: image
541
+ desc: You can embed an image in your Textile document by surrounding its URL with exclamation marks.
542
+ in: "!http://hobix.com/sample.jpg!"
543
+ html: <p><img src="http://hobix.com/sample.jpg" alt="" /></p>
544
+ lite_mode_html: <img src="http://hobix.com/sample.jpg" alt="" />
545
+ ---
546
+ name: image title
547
+ desc: A title for the image can also be provided in parens, just before the closing exclamation.
548
+ in: "!openwindow1.gif(Bunny.)!"
549
+ html: <p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p>
550
+ ---
551
+ name: image links
552
+ desc: Links can be attached to images with a colon.
553
+ in: "!openwindow1.gif!:http://hobix.com/"
554
+ html: <p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p>
555
+ ---
556
+ name: image alignments
557
+ desc: Alignments can be applied as well to images.
558
+ in: |-
559
+ !>obake.gif!
560
+
561
+ And others sat all round the small
562
+ machine and paid it to sing to them.
563
+ html: |-
564
+ <p style="float:right;"><img src="obake.gif" alt="" /></p>
565
+ <p>And others sat all round the small<br />
566
+ machine and paid it to sing to them.</p>
567
+ ---
568
+ name: acronym definitions
569
+ desc: Definitions for acronyms can be provided by following an acronym with its definition in parens.
570
+ in: We use CSS(Cascading Style Sheets).
571
+ html: <p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p>
572
+ lite_mode_html: We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.
573
+ no_span_caps_html: <p>We use <acronym title="Cascading Style Sheets">CSS</acronym>.</p>
574
+ ---
575
+ name: tables
576
+ desc: Simple tables can be built by separating fields with pipe characters
577
+ in: |-
578
+ | name | age | sex |
579
+ | joan | 24 | f |
580
+ | archie | 29 | m |
581
+ | bella | 45 | f |
582
+ html: |-
583
+ <table>
584
+ <tr>
585
+ <td> name </td>
586
+ <td> age </td>
587
+ <td> sex </td>
588
+ </tr>
589
+ <tr>
590
+ <td> joan </td>
591
+ <td> 24 </td>
592
+ <td> f </td>
593
+ </tr>
594
+ <tr>
595
+ <td> archie </td>
596
+ <td> 29 </td>
597
+ <td> m </td>
598
+ </tr>
599
+ <tr>
600
+ <td> bella </td>
601
+ <td> 45 </td>
602
+ <td> f </td>
603
+ </tr>
604
+ </table>
605
+ ---
606
+ name: table headers
607
+ desc: Specify header cells by marking them with an underscore and period.
608
+ in: |-
609
+ |_. name |_. age |_. sex |
610
+ | joan | 24 | f |
611
+ | archie | 29 | m |
612
+ | bella | 45 | f |
613
+ html: |-
614
+ <table>
615
+ <tr>
616
+ <th>name </th>
617
+ <th>age </th>
618
+ <th>sex </th>
619
+ </tr>
620
+ <tr>
621
+ <td> joan </td>
622
+ <td> 24 </td>
623
+ <td> f </td>
624
+ </tr>
625
+ <tr>
626
+ <td> archie </td>
627
+ <td> 29 </td>
628
+ <td> m </td>
629
+ </tr>
630
+ <tr>
631
+ <td> bella </td>
632
+ <td> 45 </td>
633
+ <td> f </td>
634
+ </tr>
635
+ </table>
636
+ ---
637
+ name: table cell attributes
638
+ desc: The period used above marks the end of a cell’s attributes. Other attributes can be applied as well.
639
+ in: |-
640
+ |_. attribute list |
641
+ |<. align left |
642
+ |>. align right|
643
+ |=. center |
644
+ |<>. justify |
645
+ |^. valign top |
646
+ |~. bottom |
647
+ html: |-
648
+ <table>
649
+ <tr>
650
+ <th>attribute list </th>
651
+ </tr>
652
+ <tr>
653
+ <td style="text-align:left;">align left </td>
654
+ </tr>
655
+ <tr>
656
+ <td style="text-align:right;">align right</td>
657
+ </tr>
658
+ <tr>
659
+ <td style="text-align:center;">center </td>
660
+ </tr>
661
+ <tr>
662
+ <td style="text-align:justify;">justify </td>
663
+ </tr>
664
+ <tr>
665
+ <td style="vertical-align:top;">valign top </td>
666
+ </tr>
667
+ <tr>
668
+ <td style="vertical-align:bottom;">bottom </td>
669
+ </tr>
670
+ </table>
671
+ ---
672
+ name: table colspan
673
+ desc: You can also specify colspans with a backslash, followed by the cell width.
674
+ in: |-
675
+ |\2. spans two cols |
676
+ | col 1 | col 2 |
677
+ html: |-
678
+ <table>
679
+ <tr>
680
+ <td colspan="2">spans two cols </td>
681
+ </tr>
682
+ <tr>
683
+ <td> col 1 </td>
684
+ <td> col 2 </td>
685
+ </tr>
686
+ </table>
687
+ ---
688
+ name: table rowspan
689
+ desc: Rowspan is specified by a forward slash, followed by the row height.
690
+ in: |-
691
+ |/3. spans 3 rows | a |
692
+ | b |
693
+ | c |
694
+ html: |-
695
+ <table>
696
+ <tr>
697
+ <td rowspan="3">spans 3 rows </td>
698
+ <td> a </td>
699
+ </tr>
700
+ <tr>
701
+ <td> b </td>
702
+ </tr>
703
+ <tr>
704
+ <td> c </td>
705
+ </tr>
706
+ </table>
707
+ ---
708
+ name: block attributes applied to table cells
709
+ desc: All block attributes can be applied to table cells as well.
710
+ in: "|{background:#ddd}. Grey cell|"
711
+ html: |-
712
+ <table>
713
+ <tr>
714
+ <td style="background:#ddd;">Grey cell</td>
715
+ </tr>
716
+ </table>
717
+ ---
718
+ name: black attributes applied to a table
719
+ desc: Table-wide attributes can be applied before the first row of the table. On its own line, followed by a period.
720
+ in: |-
721
+ table{border:1px solid black}.
722
+ |This|is|a|row|
723
+ |This|is|a|row|
724
+ html: |-
725
+ <table style="border:1px solid black;">
726
+ <tr>
727
+ <td>This</td>
728
+ <td>is</td>
729
+ <td>a</td>
730
+ <td>row</td>
731
+ </tr>
732
+ <tr>
733
+ <td>This</td>
734
+ <td>is</td>
735
+ <td>a</td>
736
+ <td>row</td>
737
+ </tr>
738
+ </table>
739
+ ---
740
+ name: black attributes applied to a table row
741
+ desc: Attributes can be applied to a single row by supplying the attribute before the row starts, using a <code>table</code> modifier and following it by a period.
742
+ in: |-
743
+ |This|is|a|row|
744
+ {background:#ddd}. |This|is|grey|row|
745
+ html: |-
746
+ <table>
747
+ <tr>
748
+ <td>This</td>
749
+ <td>is</td>
750
+ <td>a</td>
751
+ <td>row</td>
752
+ </tr>
753
+ <tr style="background:#ddd;">
754
+ <td>This</td>
755
+ <td>is</td>
756
+ <td>grey</td>
757
+ <td>row</td>
758
+ </tr>
759
+ </table>
760
+ ---
761
+ name: extended block followed by pre block
762
+ in: |-
763
+ div.. Just a test.
764
+
765
+ Second div.
766
+
767
+ pre. A pre block ends it.
768
+ html: |-
769
+ <div>Just a test.</div>
770
+ <div>Second div.</div>
771
+ <pre>A pre block ends it.</pre>
772
+ ---
773
+ name: extended block followed by blockquote
774
+ in: |-
775
+ div.. Just a test.
776
+
777
+ Second div.
778
+
779
+ bq. A blockquote ends it.
780
+ html: |-
781
+ <div>Just a test.</div>
782
+ <div>Second div.</div>
783
+ <blockquote>
784
+ <p>A blockquote ends it.</p>
785
+ </blockquote>
786
+ ---
787
+ name: extended block followed by block code
788
+ in: |-
789
+ div.. Just a test.
790
+
791
+ Second div.
792
+
793
+ bc. A blockcode ends it.
794
+ html: |-
795
+ <div>Just a test.</div>
796
+ <div>Second div.</div>
797
+ <pre><code>A blockcode ends it.</code></pre>
798
+ ---
799
+ name: extended block followed by notextile block
800
+ in: |-
801
+ div.. Just a test.
802
+
803
+ Second div.
804
+
805
+ notextile. A notextile block ends it.
806
+ html: |-
807
+ <div>Just a test.</div>
808
+ <div>Second div.</div>
809
+ A notextile block ends it.
810
+ valid_html: false
811
+ ---
812
+ name: simple parentheses
813
+ in: |-
814
+ before (in parens) after
815
+ html: |-
816
+ <p>before (in parens) after</p>
817
+ ---
818
+ name: parentheses in underscores
819
+ in: |-
820
+ before _(in parens)_ after
821
+ html: |-
822
+ <p>before <em>(in parens)</em> after</p>
823
+ ---
824
+ name: parentheses in asterisks
825
+ in: |-
826
+ before *(in parens)* after
827
+ html: |-
828
+ <p>before <strong>(in parens)</strong> after</p>
829
+ general_disable_inline: |-
830
+ <p>before *(in parens)* after</p>
831
+ ---
832
+ name: parentheses in underscores in quotes
833
+ in: |-
834
+ "before _(in parens)_ after"
835
+ html: |-
836
+ <p>&#8220;before <em>(in parens)</em> after&#8221;</p>
837
+ ---
838
+ name: underscores in parentheses
839
+ in: |-
840
+ one _two three_ (four _five six_) seven
841
+ html: |-
842
+ <p>one <em>two three</em> (four <em>five six</em>) seven</p>
843
+ ---
844
+ name: underscores in parentheses in quotes
845
+ in: |-
846
+ "one _two three_ (four _five six_) seven"
847
+ html: |-
848
+ <p>&#8220;one <em>two three</em> (four <em>five six</em>) seven&#8221;</p>
849
+ ---
850
+ name: underscores in parentheses 2
851
+ in: |-
852
+ one (two _three four_) five
853
+ html: |-
854
+ <p>one (two <em>three four</em>) five</p>
855
+ ---
856
+ name: underscores in parentheses in quotes 2
857
+ in: |-
858
+ "one (two _three four_) five"
859
+ html: |-
860
+ <p>&#8220;one (two <em>three four</em>) five&#8221;</p>
861
+ ---
862
+ name: caps in parentheses
863
+ desc: Uppercase words of three or more characters that are in parentheses should be recognized as well as those not in parentheses.
864
+ in: IBM or (HAL)
865
+ html: <p><span class="caps">IBM</span> or (<span class="caps">HAL</span>)</p>
866
+ no_span_caps_html: <p>IBM or (HAL)</p>
867
+ ---
868
+ name: phrase modifiers in parentheses
869
+ desc: Inline modifiers are expected to work in parentheses as well.
870
+ in: |-
871
+ __Amanita__s are mushrooms.
872
+ Lungworts (__Lobaria__) are lichens.
873
+ Blah blah (normal text **bold**) blah.
874
+ html: |-
875
+ <p>__Amanita__s are mushrooms.<br />
876
+ Lungworts (<i>Lobaria</i>) are lichens.<br />
877
+ Blah blah (normal text <b>bold</b>) blah.</p>
878
+ ---
879
+ name: square brackets are preserved
880
+ in: |-
881
+ citation ["(Berk.) Hilton"], see
882
+ [Papers "blah blah."]
883
+ html: |-
884
+ <p>citation [&#8220;(Berk.) Hilton&#8221;], see<br />
885
+ [Papers &#8220;blah blah.&#8221;]</p>
886
+ ---
887
+ name: horizontal rule using asterisks
888
+ in: |-
889
+ Just some *** text
890
+
891
+ ***
892
+
893
+ Some more text.
894
+ html: |-
895
+ <p>Just some <strong>*</strong> text</p>
896
+ <hr />
897
+ <p>Some more text.</p>
898
+ ---
899
+ name: horizontal rule using more than three asterisks
900
+ in: |-
901
+ Just some **** text
902
+
903
+ ****
904
+
905
+ Some more text.
906
+ html: |-
907
+ <p>Just some **** text</p>
908
+ <hr />
909
+ <p>Some more text.</p>
910
+ ---
911
+ name: horizontal rule using dashes
912
+ in: |-
913
+ Just some --- text
914
+
915
+ ---
916
+
917
+ Some more text.
918
+ html: |-
919
+ <p>Just some <del>-</del> text</p>
920
+ <hr />
921
+ <p>Some more text.</p>
922
+ ---
923
+ name: horizontal rule using underscores
924
+ in: |-
925
+ Just some ___ text
926
+
927
+ ___
928
+
929
+ Some more text.
930
+ html: |-
931
+ <p>Just some <em>_</em> text</p>
932
+ <hr />
933
+ <p>Some more text.</p>