jeremy-RedCloth 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG +135 -0
  2. data/COPYING +18 -0
  3. data/Manifest +56 -0
  4. data/README +171 -0
  5. data/Rakefile +205 -0
  6. data/bin/redcloth +28 -0
  7. data/ext/mingw-rbconfig.rb +176 -0
  8. data/ext/redcloth_scan/extconf.rb +9 -0
  9. data/ext/redcloth_scan/redcloth.h +178 -0
  10. data/ext/redcloth_scan/redcloth_attributes.c.rl +56 -0
  11. data/ext/redcloth_scan/redcloth_attributes.java.rl +96 -0
  12. data/ext/redcloth_scan/redcloth_attributes.rl +33 -0
  13. data/ext/redcloth_scan/redcloth_common.c.rl +18 -0
  14. data/ext/redcloth_scan/redcloth_common.java.rl +18 -0
  15. data/ext/redcloth_scan/redcloth_common.rl +111 -0
  16. data/ext/redcloth_scan/redcloth_inline.c.rl +159 -0
  17. data/ext/redcloth_scan/redcloth_inline.java.rl +108 -0
  18. data/ext/redcloth_scan/redcloth_inline.rl +159 -0
  19. data/ext/redcloth_scan/redcloth_scan.c.rl +237 -0
  20. data/ext/redcloth_scan/redcloth_scan.java.rl +573 -0
  21. data/ext/redcloth_scan/redcloth_scan.rl +325 -0
  22. data/extras/ragel_profiler.rb +73 -0
  23. data/lib/case_sensitive_require/RedCloth.rb +6 -0
  24. data/lib/redcloth.rb +37 -0
  25. data/lib/redcloth/erb_extension.rb +27 -0
  26. data/lib/redcloth/formatters/base.rb +57 -0
  27. data/lib/redcloth/formatters/html.rb +353 -0
  28. data/lib/redcloth/formatters/latex.rb +275 -0
  29. data/lib/redcloth/formatters/latex_entities.yml +2414 -0
  30. data/lib/redcloth/textile_doc.rb +103 -0
  31. data/lib/redcloth/version.rb +28 -0
  32. data/setup.rb +1585 -0
  33. data/test/basic.yml +922 -0
  34. data/test/code.yml +229 -0
  35. data/test/definitions.yml +82 -0
  36. data/test/extra_whitespace.yml +64 -0
  37. data/test/filter_html.yml +177 -0
  38. data/test/filter_pba.yml +20 -0
  39. data/test/helper.rb +108 -0
  40. data/test/html.yml +311 -0
  41. data/test/images.yml +254 -0
  42. data/test/instiki.yml +38 -0
  43. data/test/links.yml +275 -0
  44. data/test/lists.yml +283 -0
  45. data/test/poignant.yml +89 -0
  46. data/test/sanitize_html.yml +42 -0
  47. data/test/table.yml +336 -0
  48. data/test/test_custom_tags.rb +58 -0
  49. data/test/test_erb.rb +13 -0
  50. data/test/test_extensions.rb +31 -0
  51. data/test/test_formatters.rb +24 -0
  52. data/test/test_parser.rb +73 -0
  53. data/test/test_restrictions.rb +41 -0
  54. data/test/textism.yml +480 -0
  55. data/test/threshold.yml +772 -0
  56. data/test/validate_fixtures.rb +74 -0
  57. metadata +133 -0
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ class TestCustomTags < Test::Unit::TestCase
6
+
7
+ module FigureTag
8
+ def fig( opts )
9
+ label, img = opts[:text].split('|').map! {|str| str.strip}
10
+
11
+ html = %Q{<div class="img" id="figure-#{label.tr('.', '-')}">\n}
12
+ html << %Q{ <a class="fig" href="/images/#{img}">\n}
13
+ html << %Q{ <img src="/images/thumbs/#{img}" alt="Figure #{label}" />\n}
14
+ html << %Q{ </a>\n}
15
+ html << %Q{ <p>Figure #{label}</p>\n}
16
+ html << %Q{<div>\n}
17
+ end
18
+ end
19
+
20
+ def test_fig_tag
21
+ input = %Q{The first line of text.\n\n}
22
+ input << %Q{fig. 1.1 | img.jpg\n\n}
23
+ input << %Q{The last line of text.\n}
24
+ r = RedCloth.new input
25
+ r.extend FigureTag
26
+ str = r.to_html
27
+
28
+ html = %Q{<p>The first line of text.</p>\n}
29
+ html << %Q{<div class="img" id="figure-1-1">\n}
30
+ html << %Q{ <a class="fig" href="/images/img.jpg">\n}
31
+ html << %Q{ <img src="/images/thumbs/img.jpg" alt="Figure 1.1" />\n}
32
+ html << %Q{ </a>\n}
33
+ html << %Q{ <p>Figure 1.1</p>\n}
34
+ html << %Q{<div>\n}
35
+ html << %Q{<p>The last line of text.</p>}
36
+
37
+ assert_equal(html, str)
38
+ end
39
+
40
+ def test_fallback
41
+ r = RedCloth.new %Q/fig()>[no]{color:red}. 1.1 | img.jpg/
42
+ str = r.to_html
43
+
44
+ assert_equal "<p>fig()>[no]{color:red}. 1.1 | img.jpg</p>", str
45
+ end
46
+
47
+ # We don't want to call just any String method!
48
+ def test_does_not_call_standard_methods
49
+ r = RedCloth.new "next. "
50
+ r.extend FigureTag
51
+ str = r.to_html
52
+
53
+ html = "<p>next. </p>"
54
+
55
+ assert_equal(html, str)
56
+ end
57
+
58
+ end
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ class TestErb < Test::Unit::TestCase
6
+
7
+ def test_redcloth_erb
8
+ template = %{<%=t "This new ERB tag makes is so _easy_ to use *RedCloth*" %>}
9
+ expected = %{<p>This new <span class="caps">ERB</span> tag makes is so <em>easy</em> to use <strong>RedCloth</strong></p>}
10
+ assert_equal expected, ERB.new(template).result
11
+ end
12
+
13
+ end
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ class TestExtensions < Test::Unit::TestCase
6
+
7
+ require 'redcloth'
8
+
9
+ # http://www.ralree.info/2006/9/13/extending-redcloth
10
+ module RedClothSmileyExtension
11
+ def refs_smiley(text)
12
+ text.gsub!(/(\s)~(:P|:D|:O|:o|:S|:\||;\)|:'\(|:\)|:\()/) do |m|
13
+ bef,ma = $~[1..2]
14
+ filename = "/images/emoticons/"+(ma.unpack("c*").join('_'))+".png"
15
+ "#{bef}<img src='#{filename}' title='#{ma}' class='smiley' />"
16
+ end
17
+ end
18
+ end
19
+
20
+ RedCloth.send(:include, RedClothSmileyExtension)
21
+
22
+ def test_smiley
23
+ input = %Q{You're so silly! ~:P}
24
+
25
+ str = RedCloth.new(input).to_html(:textile, :refs_smiley)
26
+
27
+ html = %Q{<p>You&#8217;re so silly! <img src='/images/emoticons/58_80.png' title=':P' class='smiley' /></p>}
28
+
29
+ assert_equal(html, str)
30
+ end
31
+ end
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ class TestFormatters < Test::Unit::TestCase
6
+
7
+ generate_formatter_tests('html') do |doc|
8
+ RedCloth.new(doc['in']).to_html
9
+ end
10
+
11
+ def test_html_orphan_parenthesis_in_link_can_be_followed_by_punctuation_and_words
12
+ assert_nothing_raised { RedCloth.new(%Q{Test "(read this":http://test.host), ok}).to_html }
13
+ end
14
+
15
+ generate_formatter_tests('latex') do |doc|
16
+ RedCloth.new(doc['in']).to_latex
17
+ end
18
+
19
+ def test_latex_orphan_parenthesis_in_link_can_be_followed_by_punctuation_and_words
20
+ assert_nothing_raised { RedCloth.new(%Q{Test "(read this":http://test.host), ok}).to_latex }
21
+ end
22
+
23
+
24
+ end
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ class TestParser < Test::Unit::TestCase
6
+
7
+ def test_parser_accepts_options
8
+ assert_nothing_raised(ArgumentError) do
9
+ RedCloth.new("test", [:hard_breaks])
10
+ end
11
+ end
12
+
13
+ def test_redcloth_has_version
14
+ assert RedCloth.const_defined?("VERSION")
15
+ assert RedCloth::VERSION.const_defined?("STRING")
16
+ end
17
+
18
+ def test_redcloth_version_to_s
19
+ assert_equal RedCloth::VERSION::STRING, RedCloth::VERSION.to_s
20
+ assert RedCloth::VERSION == RedCloth::VERSION::STRING
21
+ end
22
+
23
+ def test_badly_formatted_table_does_not_segfault
24
+ assert_match(/td/, RedCloth.new(%Q{| one | two |\nthree | four |}).to_html)
25
+ end
26
+
27
+ def test_table_without_block_end_does_not_segfault
28
+ assert_match(/h3/, RedCloth.new("| a | b |\n| c | d |\nh3. foo").to_html)
29
+ end
30
+
31
+ def test_table_with_empty_cells_does_not_segfault
32
+ assert_match(/td/, RedCloth.new(%Q{|one || |\nthree | four |}).to_html)
33
+ end
34
+
35
+ def test_unfinished_html_block_does_not_segfault_with_filter_html
36
+ assert_nothing_raised { RedCloth.new(%Q{<hr> Some text}, [:filter_html]).to_html }
37
+ end
38
+
39
+ def test_redcloth_version_in_output
40
+ assert_equal "<p>#{RedCloth::VERSION::STRING}</p>", RedCloth.new("RedCloth::VERSION").to_html
41
+ end
42
+
43
+ def test_redcloth_version_only_on_line_by_itself
44
+ input = "RedCloth::VERSION won't output the RedCloth::VERSION unless it's on a line all by itself.\n\nRedCloth::VERSION"
45
+ html = "<p>RedCloth::<span class=\"caps\">VERSION</span> won&#8217;t output the RedCloth::<span class=\"caps\">VERSION</span> unless it&#8217;s on a line all by itself.</p>\n<p>#{RedCloth::VERSION::STRING}</p>"
46
+ assert_equal html, RedCloth.new(input).to_html
47
+ end
48
+
49
+ def test_redcloth_version_with_label
50
+ input = "RedCloth::VERSION: RedCloth::VERSION"
51
+ html = "<p>RedCloth::VERSION: #{RedCloth::VERSION::STRING}</p>"
52
+ assert_equal html, RedCloth.new(input).to_html
53
+ end
54
+
55
+ def test_redcloth_version_with_label_2
56
+ input = "RedCloth version RedCloth::VERSION"
57
+ html = "<p>RedCloth version #{RedCloth::VERSION::STRING}</p>"
58
+ assert_equal html, RedCloth.new(input).to_html
59
+ end
60
+
61
+ def test_inline_redcloth_version
62
+ input = "The current RedCloth version is [RedCloth::VERSION]"
63
+ html = "<p>The current RedCloth version is #{RedCloth::VERSION::STRING}</p>"
64
+ assert_equal html, RedCloth.new(input).to_html
65
+ end
66
+
67
+ def test_parser_strips_carriage_returns
68
+ input = "This is a paragraph\r\n\r\nThis is a\r\nline break.\r\n\r\n<div>\r\ntest\r\n\r\n</div>"
69
+ html = "<p>This is a paragraph</p>\n<p>This is a<br />\nline break.</p>\n<div>\n<p>test</p>\n</div>"
70
+ assert_equal html, RedCloth.new(input).to_html
71
+ end
72
+
73
+ end
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ class TestRestrictions < Test::Unit::TestCase
6
+
7
+ # security restrictions
8
+ generate_formatter_tests('filtered_html') do |doc|
9
+ RedCloth.new(doc['in'], [:filter_html]).to_html
10
+ end
11
+ generate_formatter_tests('sanitized_html') do |doc|
12
+ RedCloth.new(doc['in'], [:sanitize_html]).to_html
13
+ end
14
+
15
+ # pba filters (style, class, id)
16
+ generate_formatter_tests('style_filtered_html') do |doc|
17
+ RedCloth.new(doc['in'], [:filter_styles]).to_html
18
+ end
19
+ generate_formatter_tests('class_filtered_html') do |doc|
20
+ RedCloth.new(doc['in'], [:filter_classes]).to_html
21
+ end
22
+ generate_formatter_tests('id_filtered_html') do |doc|
23
+ RedCloth.new(doc['in'], [:filter_ids]).to_html
24
+ end
25
+
26
+ # hard breaks - has been deprecated and will be removed in a future version
27
+ generate_formatter_tests('html_no_breaks') do |doc|
28
+ red = RedCloth.new(doc['in'])
29
+ red.hard_breaks = false
30
+ red.to_html
31
+ end
32
+
33
+ generate_formatter_tests('lite_mode_html') do |doc|
34
+ RedCloth.new(doc['in'], [:lite_mode]).to_html
35
+ end
36
+
37
+ generate_formatter_tests('no_span_caps_html') do |doc|
38
+ RedCloth.new(doc['in'], [:no_span_caps]).to_html
39
+ end
40
+
41
+ end
@@ -0,0 +1,480 @@
1
+ ---
2
+ name: header one
3
+ in: h1. Header 1
4
+ html: <h1>Header 1</h1>
5
+ latex: "\section*{Header 1}\n\n"
6
+ ---
7
+ name: header two
8
+ in: h2. Header 2
9
+ html: <h2>Header 2</h2>
10
+ latex: "\subsection*{Header 2}\n\n"
11
+ ---
12
+ name: header three
13
+ in: h3. Header 3
14
+ html: <h3>Header 3</h3>
15
+ latex: "\subsubsection*{Header 3}\n\n"
16
+ ---
17
+ name: blockquote
18
+ in: |-
19
+ Any old text.
20
+
21
+ bq. A block quotation.
22
+
23
+ Any old text.
24
+
25
+ html: |-
26
+ <p>Any old text.</p>
27
+ <blockquote>
28
+ <p>A block quotation.</p>
29
+ </blockquote>
30
+ <p>Any old text.</p>
31
+
32
+ latex: |+
33
+ Any old text.
34
+
35
+ \begin{quotation}
36
+ A block quotation.
37
+
38
+ \end{quotation}
39
+
40
+ Any old text.
41
+
42
+ ---
43
+ in: |-
44
+ # A first item
45
+ # A second item
46
+ # A third item
47
+ # A fourth item
48
+ html: |-
49
+ <ol>
50
+ <li>A first item</li>
51
+ <li>A second item</li>
52
+ <li>A third item</li>
53
+ <li>A fourth item</li>
54
+ </ol>
55
+ latex: |+
56
+ \begin{enumerate}
57
+ \item A first item
58
+ \item A second item
59
+ \item A third item
60
+ \item A fourth item
61
+ \end{enumerate}
62
+
63
+ ---
64
+ in: |-
65
+ * A first item
66
+ * A second item
67
+ * A third item
68
+ * A fourth item
69
+
70
+ html: |-
71
+ <ul>
72
+ <li>A first item</li>
73
+ <li>A second item</li>
74
+ <li>A third item</li>
75
+ <li>A fourth item</li>
76
+ </ul>
77
+ latex: |+
78
+ \begin{itemize}
79
+ \item A first item
80
+ \item A second item
81
+ \item A third item
82
+ \item A fourth item
83
+ \end{itemize}
84
+
85
+ ---
86
+ in: _a phrase_
87
+ html: <p><em>a phrase</em></p>
88
+ latex: "\\emph{a phrase}\n\n"
89
+ ---
90
+ in: __a phrase__
91
+ html: <p><i>a phrase</i></p>
92
+ latex: "\\textit{a phrase}\n\n"
93
+ ---
94
+ in: '*a phrase*'
95
+ html: <p><strong>a phrase</strong></p>
96
+ latex: "\\textbf{a phrase}\n\n"
97
+ ---
98
+ in: '**a phrase**'
99
+ html: <p><b>a phrase</b></p>
100
+ latex: "\\textbf{a phrase}\n\n"
101
+ ---
102
+ in: Nabokov's ??Pnin??
103
+ html: <p>Nabokov&#8217;s <cite>Pnin</cite></p>
104
+ latex: "Nabokov's \\begin{quote}Pnin\\end{quote}\n\n"
105
+ ---
106
+ name: del part of word
107
+ in: 'A very [-extra-]ordinary day.'
108
+ html: "<p>A very <del>extra</del>ordinary day.</p>"
109
+ latex: "A very \\sout{extra}ordinary day.\n\n"
110
+ ---
111
+ name: del part of word that contains a hyphen
112
+ in: 'An [-extra-extra-]ordinary day.'
113
+ html: <p>An <del>extra-extra</del>ordinary day.</p>
114
+ latex: "An \\sout{extra-extra}ordinary day.\n\n"
115
+ ---
116
+ name: del a phrase
117
+ in: 'Delete -a phrase- this way.'
118
+ html: <p>Delete <del>a phrase</del> this way.</p>
119
+ latex: "Delete \\sout{a phrase} this way.\n\n"
120
+ ---
121
+ name: del a phrase that contains hyphens
122
+ in: 'Delete -a no-nonsense phrase- this way.'
123
+ html: <p>Delete <del>a no-nonsense phrase</del> this way.</p>
124
+ latex: "Delete \\sout{a no-nonsense phrase} this way.\n\n"
125
+ ---
126
+ in: +a phrase+
127
+ html: <p><ins>a phrase</ins></p>
128
+ latex: "\\underline{a phrase}\n\n"
129
+ ---
130
+ in: ^a phrase^
131
+ html: <p><sup>a phrase</sup></p>
132
+ latex: "\\ensuremath{^\\textrm{a phrase}}\n\n"
133
+ ---
134
+ in: ~a phrase~
135
+ html: <p><sub>a phrase</sub></p>
136
+ ---
137
+ in: %(myclass)SPAN%
138
+ html: <p><span class="myclass"><span class="caps">SPAN</span></span></p>
139
+ no_span_caps_html: <p><span class="myclass">SPAN</span></p>
140
+ ---
141
+ in: %{color:red}red%
142
+ html: <p><span style="color:red;">red</span></p>
143
+ ---
144
+ in: %[fr]rouge%
145
+ html: <p><span lang="fr">rouge</span></p>
146
+ ---
147
+ in: _(big)red_
148
+ html: <p><em class="big">red</em></p>
149
+ ---
150
+ in: p(bob). A paragraph
151
+ html: <p class="bob">A paragraph</p>
152
+ ---
153
+ in: p{color:#ddd}. A paragraph
154
+ html: <p style="color:#ddd;">A paragraph</p>
155
+ ---
156
+ in: p[fr]. A paragraph
157
+ html: <p lang="fr">A paragraph</p>
158
+ ---
159
+ in: h2()>. right-aligned header2, indented 1em both side
160
+ html: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">right-aligned header2, indented 1em both side</h2>
161
+ ---
162
+ in: h3=. centered header
163
+ html: <h3 style="text-align:center;">centered header</h3>
164
+ ---
165
+ in: '!>/image.gif! right-aligned image'
166
+ html: <p style="float:right;"><img src="/image.gif" alt="" /> right-aligned image</p>
167
+ ---
168
+ in: p[no]{color:red}. A Norse of a different colour.
169
+ html: <p style="color:red;" lang="no">A Norse of a different colour.</p>
170
+ ---
171
+ in: |-
172
+ |This|is|a|simple|table|
173
+ |This|is|a|simple|row|
174
+ html: |-
175
+ <table>
176
+ <tr>
177
+ <td>This</td>
178
+ <td>is</td>
179
+ <td>a</td>
180
+ <td>simple</td>
181
+ <td>table</td>
182
+ </tr>
183
+ <tr>
184
+ <td>This</td>
185
+ <td>is</td>
186
+ <td>a</td>
187
+ <td>simple</td>
188
+ <td>row</td>
189
+ </tr>
190
+ </table>
191
+ ---
192
+ in: |-
193
+ table{border:1px solid black}.
194
+ |This|is|a|row|
195
+ |This|is|a|row|
196
+ html: |-
197
+ <table style="border:1px solid black;">
198
+ <tr>
199
+ <td>This</td>
200
+ <td>is</td>
201
+ <td>a</td>
202
+ <td>row</td>
203
+ </tr>
204
+ <tr>
205
+ <td>This</td>
206
+ <td>is</td>
207
+ <td>a</td>
208
+ <td>row</td>
209
+ </tr>
210
+ </table>
211
+ ---
212
+ in: '{background:#ddd}. |This|is|a|row|'
213
+ html: |-
214
+ <table>
215
+ <tr style="background:#ddd;">
216
+ <td>This</td>
217
+ <td>is</td>
218
+ <td>a</td>
219
+ <td>row</td>
220
+ </tr>
221
+ </table>
222
+ ---
223
+ in: |-
224
+ |{background:#ddd}. Cell with gray background|
225
+ |\2. Cell spanning 2 columns|
226
+ |/3. Cell spanning 3 rows|
227
+ |>. Right-aligned cell|
228
+ html: |-
229
+ <table>
230
+ <tr>
231
+ <td style="background:#ddd;">Cell with gray background</td>
232
+ </tr>
233
+ <tr>
234
+ <td colspan="2">Cell spanning 2 columns</td>
235
+ </tr>
236
+ <tr>
237
+ <td rowspan="3">Cell spanning 3 rows</td>
238
+ </tr>
239
+ <tr>
240
+ <td style="text-align:right;">Right-aligned cell</td>
241
+ </tr>
242
+ </table>
243
+ ---
244
+ name: basics
245
+ in: |-
246
+ h2{color:green}. This is a title
247
+
248
+ h3. This is a subhead
249
+
250
+ p{color:red}. This is some text of dubious character. Isn't the use of "quotes" just lazy writing -- and theft of 'intellectual property' besides? I think the time has come to see a block quote.
251
+
252
+ bq[fr]. This is a block quote. I'll admit it's not the most exciting block quote ever devised.
253
+
254
+ Simple list:
255
+
256
+ #{color:blue} one
257
+ # two
258
+ # three
259
+
260
+ Multi-level list:
261
+
262
+ # one
263
+ ## aye
264
+ ## bee
265
+ ## see
266
+ # two
267
+ ## x
268
+ ## y
269
+ # three
270
+
271
+ html: |-
272
+ <h2 style="color:green;">This is a title</h2>
273
+ <h3>This is a subhead</h3>
274
+ <p style="color:red;">This is some text of dubious character. Isn&#8217;t the use of &#8220;quotes&#8221; just lazy writing &#8212; and theft of &#8216;intellectual property&#8217; besides? I think the time has come to see a block quote.</p>
275
+ <blockquote lang="fr">
276
+ <p lang="fr">This is a block quote. I&#8217;ll admit it&#8217;s not the most exciting block quote ever devised.</p>
277
+ </blockquote>
278
+ <p>Simple list:</p>
279
+ <ol style="color:blue;">
280
+ <li>one</li>
281
+ <li>two</li>
282
+ <li>three</li>
283
+ </ol>
284
+ <p>Multi-level list:</p>
285
+ <ol>
286
+ <li>one
287
+ <ol>
288
+ <li>aye</li>
289
+ <li>bee</li>
290
+ <li>see</li>
291
+ </ol></li>
292
+ <li>two
293
+ <ol>
294
+ <li>x</li>
295
+ <li>y</li>
296
+ </ol></li>
297
+ <li>three</li>
298
+ </ol>
299
+ ---
300
+ name: tougher stuff
301
+ in: |-
302
+
303
+ Multi-level list:
304
+
305
+ # one
306
+ ## aye
307
+ ## bee
308
+ ## see
309
+ # two
310
+ ## x
311
+ ## y
312
+ # three
313
+
314
+ Mixed list:
315
+
316
+ * Point one
317
+ * Point two
318
+ ## Step 1
319
+ ## Step 2
320
+ ## Step 3
321
+ * Point three
322
+ ** Sub point 1
323
+ ** Sub point 2
324
+
325
+
326
+ Well, that went well. How about we insert an <a href="/" title="watch out">old-fashioned hypertext link</a>? Will the quote marks in the tags get messed up? No!
327
+
328
+ "This is a link (optional title)":http://www.textism.com
329
+
330
+ html: |-
331
+ <p>Multi-level list:</p>
332
+ <ol>
333
+ <li>one
334
+ <ol>
335
+ <li>aye</li>
336
+ <li>bee</li>
337
+ <li>see</li>
338
+ </ol></li>
339
+ <li>two
340
+ <ol>
341
+ <li>x</li>
342
+ <li>y</li>
343
+ </ol></li>
344
+ <li>three</li>
345
+ </ol>
346
+ <p>Mixed list:</p>
347
+ <ul>
348
+ <li>Point one</li>
349
+ <li>Point two
350
+ <ol>
351
+ <li>Step 1</li>
352
+ <li>Step 2</li>
353
+ <li>Step 3</li>
354
+ </ol></li>
355
+ <li>Point three
356
+ <ul>
357
+ <li>Sub point 1</li>
358
+ <li>Sub point 2</li>
359
+ </ul></li>
360
+ </ul>
361
+ <p>Well, that went well. How about we insert an <a href="/" title="watch out">old-fashioned hypertext link</a>? Will the quote marks in the tags get messed up? No!</p>
362
+ <p><a href="http://www.textism.com" title="optional title">This is a link</a></p>
363
+ ---
364
+ name: table
365
+ in: |-
366
+ table{border:1px solid black}.
367
+ |_. this|_. is|_. a|_. header|
368
+ <{background:gray}. |\2. this is|{background:red;width:200px}. a|^<>{height:200px}. row|
369
+ |this|<>{padding:10px}. is|^. another|(bob#bob). row|
370
+ html: |-
371
+ <table style="border:1px solid black;">
372
+ <tr>
373
+ <th>this</th>
374
+ <th>is</th>
375
+ <th>a</th>
376
+ <th>header</th>
377
+ </tr>
378
+ <tr style="text-align:left;background:gray;">
379
+ <td colspan="2">this is</td>
380
+ <td style="background:red;width:200px;">a</td>
381
+ <td style="vertical-align:top;text-align:justify;height:200px;">row</td>
382
+ </tr>
383
+ <tr>
384
+ <td>this</td>
385
+ <td style="text-align:justify;padding:10px;">is</td>
386
+ <td style="vertical-align:top;">another</td>
387
+ <td class="bob" id="bob">row</td>
388
+ </tr>
389
+ </table>
390
+ ---
391
+ in: |-
392
+ An image:
393
+
394
+ !/common/textist.gif(optional alt text)!
395
+
396
+ # Librarians rule
397
+ # Yes they do
398
+ # But you knew that
399
+
400
+ Some more text of dubious character. Here is a noisome string of CAPITAL letters. Here is something we want to _emphasize_.
401
+ That was a linebreak. And something to indicate *strength*. Of course I could use <em>my own HTML tags</em> if I <strong>felt</strong> like it.
402
+ html: |-
403
+ <p>An image:</p>
404
+ <p><img src="/common/textist.gif" title="optional alt text" alt="optional alt text" /></p>
405
+ <ol>
406
+ <li>Librarians rule</li>
407
+ <li>Yes they do</li>
408
+ <li>But you knew that</li>
409
+ </ol>
410
+ <p>Some more text of dubious character. Here is a noisome string of <span class="caps">CAPITAL</span> letters. Here is something we want to <em>emphasize</em>.<br />
411
+ That was a linebreak. And something to indicate <strong>strength</strong>. Of course I could use <em>my own <span class="caps">HTML</span> tags</em> if I <strong>felt</strong> like it.</p>
412
+ ---
413
+ name: code
414
+ in: |-
415
+ h3. Coding
416
+
417
+ This <code>is some code, "isn't it"</code>. Watch those quote marks! Now for some preformatted text:
418
+
419
+ <pre>
420
+ <code>
421
+ $text = str_replace("<p>%::%</p>","",$text);
422
+ $text = str_replace("%::%</p>","",$text);
423
+ $text = str_replace("%::%","",$text);
424
+
425
+ </code>
426
+ </pre>
427
+
428
+ This isn't code.
429
+
430
+
431
+ html: |-
432
+ <h3>Coding</h3>
433
+ <p>This <code>is some code, "isn't it"</code>. Watch those quote marks! Now for some preformatted text:</p>
434
+ <pre>
435
+ <code>
436
+ $text = str_replace("&lt;p&gt;%::%&lt;/p&gt;","",$text);
437
+ $text = str_replace("%::%&lt;/p&gt;","",$text);
438
+ $text = str_replace("%::%","",$text);
439
+
440
+ </code>
441
+ </pre>
442
+ <p>This isn&#8217;t code.</p>
443
+ ---
444
+ name: hard break
445
+ in: |-
446
+ trivial
447
+ break
448
+
449
+ next
450
+ html: |-
451
+ <p>trivial<br />
452
+ break</p>
453
+ <p>next</p>
454
+ ---
455
+ name: normal paragraphs
456
+ in: |-
457
+ trivial
458
+
459
+ paragraphs
460
+ html: |-
461
+ <p>trivial</p>
462
+ <p>paragraphs</p>
463
+ ---
464
+ name: hard break in a list
465
+ in: |-
466
+ * first line
467
+ * second
468
+ line
469
+ * third line
470
+ html: |-
471
+ <ul>
472
+ <li>first line</li>
473
+ <li>second<br />
474
+ line</li>
475
+ <li>third line</li>
476
+ </ul>
477
+ ---
478
+ name: copyright symbol at line start
479
+ in: "(C) copyright conversion (C) test."
480
+ html: "<p>&#169; copyright conversion &#169; test.</p>"