jgarber / redcloth

RedCloth is a Ruby library for converting Textile into HTML.

This URL has Read+Write access

redcloth / spec / fixtures / links.yml
100644 291 lines (288 sloc) 13.654 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
---
in: '"link text":#1'
html: <p><a href="#1">link text</a></p>
---
in: '"link text":#a'
html: <p><a href="#a">link text</a></p>
---
in: '"link text":#a1'
html: <p><a href="#a1">link text</a></p>
---
in: '"link text":#a10'
html: <p><a href="#a10">link text</a></p>
---
in: '"link text":index.html'
html: <p><a href="index.html">link text</a></p>
---
in: '"link text":index.html#1'
html: <p><a href="index.html#1">link text</a></p>
---
in: '"link text":index.html#a'
html: <p><a href="index.html#a">link text</a></p>
---
in: '"link text":index.html#a1'
html: <p><a href="index.html#a1">link text</a></p>
---
in: '"link text":index.html#a10'
html: <p><a href="index.html#a10">link text</a></p>
---
in: '"link text":http://example.com/'
html: <p><a href="http://example.com/">link text</a></p>
---
in: '"link text":http://example.com/#1'
html: <p><a href="http://example.com/#1">link text</a></p>
---
in: '"link text":http://example.com/#a'
html: <p><a href="http://example.com/#a">link text</a></p>
---
in: '"link text":http://example.com/#a1'
html: <p><a href="http://example.com/#a1">link text</a></p>
---
in: '"link text":http://example.com/#a10'
html: <p><a href="http://example.com/#a10">link text</a></p>
---
in: '"link text":http://example.com/index.html'
html: <p><a href="http://example.com/index.html">link text</a></p>
---
in: '"link text":http://example.com/index.html#a'
html: <p><a href="http://example.com/index.html#a">link text</a></p>
---
in: '"link text":http://example.com/index.html#1'
html: <p><a href="http://example.com/index.html#1">link text</a></p>
---
in: '"link text":http://example.com/index.html#a1'
html: <p><a href="http://example.com/index.html#a1">link text</a></p>
---
in: '"link text":http://example.com/index.html#a10'
html: <p><a href="http://example.com/index.html#a10">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar'
html: <p><a href="http://example.com/?foo=bar">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar#a'
html: <p><a href="http://example.com/?foo=bar#a">link text</a></p>
---
in: '"link & text":http://example.com/?foo=bar#a'
html: <p><a href="http://example.com/?foo=bar#a">link &amp; text</a></p>
---
in: '"link text":http://example.com/?foo=bar#1'
html: <p><a href="http://example.com/?foo=bar#1">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar#a1'
html: <p><a href="http://example.com/?foo=bar#a1">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar#a10'
html: <p><a href="http://example.com/?foo=bar#a10">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar&a=b'
html: <p><a href="http://example.com/?foo=bar&amp;a=b">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar&a=b#1'
html: <p><a href="http://example.com/?foo=bar&amp;a=b#1">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar&a=b#a'
html: <p><a href="http://example.com/?foo=bar&amp;a=b#a">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar&a=b#a1'
html: <p><a href="http://example.com/?foo=bar&amp;a=b#a1">link text</a></p>
---
in: '"link text":http://example.com/?foo=bar&a=b#a10'
html: <p><a href="http://example.com/?foo=bar&amp;a=b#a10">link text</a></p>
---
in: 'This is a "link":http://example.com/'
html: <p>This is a <a href="http://example.com/">link</a></p>
---
in: 'This is a "link":http://example.com/.'
html: <p>This is a <a href="http://example.com/">link</a>.</p>
---
in: 'This is a "link":http://example.com/index.html.'
html: <p>This is a <a href="http://example.com/index.html">link</a>.</p>
---
in: 'This is a "link":http://example.com/index.html#a.'
html: <p>This is a <a href="http://example.com/index.html#a">link</a>.</p>
---
in: 'This is a "link":http://example.com/index.html#1.'
html: <p>This is a <a href="http://example.com/index.html#1">link</a>.</p>
---
in: 'This is a "link":http://example.com/index.html#a1.'
html: <p>This is a <a href="http://example.com/index.html#a1">link</a>.</p>
---
in: 'This is a "link":http://example.com/index.html#a10.'
html: <p>This is a <a href="http://example.com/index.html#a10">link</a>.</p>
---
in: 'This is a "link":http://example.com/?foo=bar.'
html: <p>This is a <a href="http://example.com/?foo=bar">link</a>.</p>
---
in: 'This is a "link":http://example.com/?foo=bar#1.'
html: <p>This is a <a href="http://example.com/?foo=bar#1">link</a>.</p>
---
in: 'This is a "link":http://example.com/?foo=bar#a.'
html: <p>This is a <a href="http://example.com/?foo=bar#a">link</a>.</p>
---
in: 'This is a "link":http://example.com/?foo=bar#a1.'
html: <p>This is a <a href="http://example.com/?foo=bar#a1">link</a>.</p>
---
in: 'This is a "link":http://example.com/?foo=bar#a10.'
html: <p>This is a <a href="http://example.com/?foo=bar#a10">link</a>.</p>
---
in: 'This is a "link":http://example.com/?foo=bar#a10, but this is not.'
html: <p>This is a <a href="http://example.com/?foo=bar#a10">link</a>, but this is not.</p>
---
in: '(This is a "link":http://example.com/?foo=bar#a10) but this is not.'
html: <p>(This is a <a href="http://example.com/?foo=bar#a10">link</a>) but this is not.</p>
---
in: '"link text(link title)":http://example.com/'
html: <p><a href="http://example.com/" title="link title">link text</a></p>
# ---
# in: '"link text(link title) ":http://example.com/'
# html: <p>&#8220;link text(link title) &#8220;:http://example.com/</p>
# comments: this is a real test and should pass
---
name: link with title attribute
in: '"(link) text(link title)":http://example.com/'
html: <p><a href="http://example.com/" class="link" title="link title">text</a></p>
comments: link text can not contain parentheses
---
name: link with space between link text and title attribute
in: '"text (link title)":http://example.com/'
html: <p><a href="http://example.com/" title="link title">text</a></p>
---
in: '"Dive Into XML":http://www.xml.com/pub/au/164'
html: <p><a href="http://www.xml.com/pub/au/164">Dive Into <span class="caps">XML</span></a></p>
---
in: '"Lab Exercises":../lab/exercises/exercises.html.'
html: <p><a href="../lab/exercises/exercises.html">Lab Exercises</a>.</p>
---
in: 'Go to "discuss":http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&thread=26627 to discuss.'
html: <p>Go to <a href="http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&amp;thread=26627">discuss</a> to discuss.</p>
---
in: '* "rubylang":http://www.ruby-lang.org/en/'
html: "<ul>\n\t<li><a href=\"http://www.ruby-lang.org/en/\">rubylang</a></li>\n</ul>"
---
in: 'The ION coding style document found at "IONCodingStyleGuide.doc":http://perforce:8081/@md=d&cd=//&c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22 codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in ION. Test text'
html: <p>The <span class="caps">ION</span> coding style document found at <a href="http://perforce:8081/@md=d&amp;cd=//&amp;c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22">IONCodingStyleGuide.doc</a> codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in <span class="caps">ION</span>. Test text</p>
---
in: '"testing":'
html: "<p>&#8220;testing&#8221;:</p>"
---
name: trailing space not absorbed by link
in: '"Link":/foo.html me'
html: "<p><a href=\"/foo.html\">Link</a> me</p>"
---
name: trailing comma stays outside link
in: '"Link":/foo.html, me'
html: "<p><a href=\"/foo.html\">Link</a>, me</p>"
---
name: trailing exclamation stays outside link
in: '"Link":/foo.html! me'
html: "<p><a href=\"/foo.html\">Link</a>! me</p>"
---
name: trailing semicolon stays outside link
in: '"Link":/foo.html; me'
html: "<p><a href=\"/foo.html\">Link</a>; me</p>"
---
name: trailing period stays outside link
in: '"Link":/foo.html.'
html: "<p><a href=\"/foo.html\">Link</a>.</p>"
---
name: whose text is a parenthetical statement
in: '"(just in case you were wondering)":http://slashdot.org/'
html: '<p><a href="http://slashdot.org/">(just in case you were wondering)</a></p>'
---
name: that has a class and whose text is a parenthetical statement
in: '"(myclass) (just in case you were wondering)":http://slashdot.org/'
html: '<p><a href="http://slashdot.org/" class="myclass">(just in case you were wondering)</a></p>'
---
name: link containing parentheses
in: '"It is (very) fortunate that this works":http://slashdot.org/'
html: '<p><a href="http://slashdot.org/">It is (very) fortunate that this works</a></p>'
---
name: link containing quotes
in: '"He said it is "very unlikely" this works":http://slashdot.org/'
html: '<p><a href="http://slashdot.org/">He said it is &#8220;very unlikely&#8221; this works</a></p>'
---
name: link containing multiple quotes
in: '"He said it is "very unlikely" the "economic stimulus" works":http://slashdot.org/'
html: '<p><a href="http://slashdot.org/">He said it is &#8220;very unlikely&#8221; the &#8220;economic stimulus&#8221; works</a></p>'
---
name: linked quoted phrase
in: '""Open the pod bay doors please, HAL."":http://www.youtube.com/watch?v=npN9l2Bd06s'
html: '<p><a href="http://www.youtube.com/watch?v=npN9l2Bd06s">&#8220;Open the pod bay doors please, <span class="caps">HAL</span>.&#8221;</a></p>'
---
name: link following quoted phrase
in: '"quote" text "quote" text "link":http://google.com'
html: '<p>&#8220;quote&#8221; text &#8220;quote&#8221; text <a href="http://google.com">link</a></p>'
---
name: links containing underscores
in: 'This is a link to a "Wikipedia article about Barack":http://en.wikipedia.org/wiki/Barack_Obama'
html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Barack_Obama">Wikipedia article about Barack</a></p>'
---
name: links containing parentheses
in: 'This is a link to a ["Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language)]'
html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a></p>'
---
name: links contained in parentheses
in: 'This is a regular link (but in parentheses: "Google":http://www.google.com)'
html: '<p>This is a regular link (but in parentheses: <a href="http://www.google.com">Google</a>)</p>'
---
name: links containing parentheses without brackets
in: 'This is a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language)'
html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a></p>'
---
name: links containing parentheses period at end without brackets
in: 'This is a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language).'
html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a>.</p>'
---
name: broken links containing parentheses without brackets
in: 'This is a link to a "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language'
html: '<p>This is a link to a <a href="http://en.wikipedia.org/wiki/Textile_(markup_language">Wikipedia article about Textile</a></p>'
---
name: links containing parentheses without brackets inside a parenthesis
in: 'Textile is awesome! (Check out the "Wikipedia article about Textile":http://en.wikipedia.org/wiki/Textile_(markup_language))'
html: '<p>Textile is awesome! (Check out the <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Wikipedia article about Textile</a>)</p>'
---
name: quotes and follow link
in: 'Some "text" followed by a "link":http://redcloth.org.'
html: '<p>Some &#8220;text&#8221; followed by a <a href="http://redcloth.org">link</a>.</p>'
lite_mode_html: 'Some &#8220;text&#8221; followed by a <a href="http://redcloth.org">link</a>.'
---
name: link alias containing dashes
in: |-
  "link":google-rocks
  
  [google-rocks]http://google.com
html: |-
  <p><a href="http://google.com">link</a></p>
---
name: contained in multi-paragraph quotes
in: |-
  "I first learned about "Redcloth":http://redcloth.org/ several years ago.
 
  "It's wonderful."
html: |-
  <p>&#8220;I first learned about <a href="http://redcloth.org/">Redcloth</a> several years ago.</p>
  <p>&#8220;It&#8217;s wonderful.&#8221;</p>
---
name: as html in notextile contained in multi-paragraph quotes
in: |-
  "Here is a <notextile><a href="http://redcloth.org/">link</a></notextile>.
 
  "I like links."
html: |-
  <p>&#8220;Here is a <a href="http://redcloth.org/">link</a>.</p>
  <p>&#8220;I like links.&#8221;</p>
---
name: contained in para with multiple quotes
in: |-
  "My wife, Tipper, and I will donate 100% of the proceeds of the award to the "Alliance For Climate Protection":http://www.looktothestars.org/charity/638-alliance-for-climate-protection," said Gore in an email. "I am deeply honored to receive the Nobel Peace Prize."
html: |-
  <p>&#8220;My wife, Tipper, and I will donate 100% of the proceeds of the award to the <a href="http://www.looktothestars.org/charity/638-alliance-for-climate-protection">Alliance For Climate Protection</a>,&#8221; said Gore in an email. &#8220;I am deeply honored to receive the Nobel Peace Prize.&#8221;</p>
---
name: with caps in the title
in: |-
  "British Skin Foundation (BSF)":http://www.britishskinfoundation.org.uk
html: |-
  <p><a href="http://www.britishskinfoundation.org.uk" title="BSF">British Skin Foundation</a></p>
---
name: containing HTML tags with quotes
in: |-
  "<r:attachment:image name="checkmark.gif" alt="Apply online" />*apply online*":/admissions/apply/
html: |-
  <p><a href="/admissions/apply/"><r:attachment:image name="checkmark.gif" alt="Apply online" /><strong>apply online</strong></a></p>