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