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/html.yml ADDED
@@ -0,0 +1,313 @@
1
+ ---
2
+ in: '*this <span></span> is strong*'
3
+ html: '<p><strong>this <span></span> is strong</strong></p>'
4
+ general_disable_inline: '<p>*this &lt;span&gt;&lt;/span&gt; is strong*</p>'
5
+ ---
6
+ in: '*this <span>test</span> is strong*'
7
+ html: '<p><strong>this <span>test</span> is strong</strong></p>'
8
+ ---
9
+ in: 'A simple <!-- HTML comment -->'
10
+ html: '<p>A simple <!-- HTML comment --></p>'
11
+ ---
12
+ in: 'A simple <!-- HTML comment with hy-phen-a-tion -->'
13
+ html: '<p>A simple <!-- HTML comment with hy-phen-a-tion --></p>'
14
+ ---
15
+ name: no breaks between HTML elements
16
+ in: |-
17
+ <ul>
18
+ <li>You can put HTML code right in Textile.</li>
19
+ <li>It will not insert a break between elements</li>
20
+ <li>or wrap it all in a p tag.</li>
21
+ <li>It should insert a hard break
22
+ if you break.</li>
23
+ </ul>
24
+ html: |-
25
+ <ul>
26
+ <li>You can put <span class="caps">HTML</span> code right in Textile.</li>
27
+ <li>It will not insert a break between elements</li>
28
+ <li>or wrap it all in a p tag.</li>
29
+ <li>It should insert a hard break<br />
30
+ if you break.</li>
31
+ </ul>
32
+ ---
33
+ name: mixing of textile and XHTML
34
+ in: |-
35
+ <img src="test.jpg" alt="test" />
36
+
37
+ Regular *paragraph*.
38
+
39
+ <div class="test">
40
+ This is one paragraph.
41
+
42
+ This is another.
43
+
44
+ !an/image.jpg!
45
+
46
+ * A list
47
+ * in a div.
48
+
49
+ </div>
50
+
51
+ Another paragraph.
52
+ html: |-
53
+ <p><img src="test.jpg" alt="test" /></p>
54
+ <p>Regular <strong>paragraph</strong>.</p>
55
+ <div class="test">
56
+ <p>This is one paragraph.</p>
57
+ <p>This is another.</p>
58
+ <p><img src="an/image.jpg" alt="" /></p>
59
+ <ul>
60
+ <li>A list</li>
61
+ <li>in a div.</li>
62
+ </ul>
63
+ </div>
64
+ <p>Another paragraph.</p>
65
+ ---
66
+ name: mixing of textile and XHTML
67
+ in: |-
68
+ <img src="test.jpg" alt="test" />
69
+
70
+ Regular *paragraph*.
71
+ html: |-
72
+ <p><img src="test.jpg" alt="test" /></p>
73
+ <p>Regular <strong>paragraph</strong>.</p>
74
+ ---
75
+ name: wraps inline HTML in paragraphs
76
+ in: '<em>asd</em> blabla "google":http://google.com'
77
+ html: '<p><em>asd</em> blabla <a href="http://google.com">google</a></p>'
78
+ ---
79
+ name: self closing XHTML with following text not recognized
80
+ comment: it will not recognize the self-closing block element
81
+ in: '<hr/> this has been a horizontal rule'
82
+ html: '<p><hr/> this has been a horizontal rule</p>'
83
+ valid_html: false
84
+ ---
85
+ name: self closing HTML with following text not recognized
86
+ comment: it will not recognize the self-closing block element
87
+ in: '<hr> that was a horizontal rule too'
88
+ html: '<hr> that was a horizontal rule too'
89
+ valid_html: false
90
+ ---
91
+ name: preserves block html
92
+ in: |-
93
+ <div>123 Anystreet</div>
94
+
95
+ <p foo="bar">Explicit paragraph</p>
96
+ html: |-
97
+ <div>123 Anystreet</div>
98
+ <p foo="bar">Explicit paragraph</p>
99
+ valid_html: false
100
+ ---
101
+ name: preserves empty block standalone elements
102
+ in: "<hr />"
103
+ html: "<hr />"
104
+ valid_html: false
105
+ ---
106
+ name: unfinished standalone HTML
107
+ in: |-
108
+ <div>
109
+ This is some div text.
110
+
111
+ More div text.
112
+ html: |-
113
+ <div>
114
+ <p>This is some div text.</p>
115
+ <p>More div text.</p>
116
+ valid_html: false
117
+ ---
118
+ name: unfinished HTML block
119
+ in: |-
120
+ <div>This is some div text.
121
+
122
+ More div text.
123
+ html: |-
124
+ <div>This is some div text.<br />
125
+ <br />
126
+ More div text.
127
+ valid_html: false
128
+ ---
129
+ name: complex example from real life
130
+ in: |-
131
+ <div class="span-17 last">
132
+ <div class="span-8"><r:attachment:image name="logo.jpg" /></div>
133
+
134
+ <div class="span-9 last">
135
+ h1. Contact
136
+
137
+ Please contact us if you have questions or need help making arrangements.
138
+
139
+ </div>
140
+ </div>
141
+
142
+ <div class="span-8">
143
+ h2. Tom
144
+
145
+ (540) 555-1212
146
+
147
+ h3. Jerry
148
+
149
+ (540) 555-1234
150
+
151
+ </div>
152
+ html: |-
153
+ <div class="span-17 last">
154
+ <div class="span-8"><r:attachment:image name="logo.jpg" /></div>
155
+ <div class="span-9 last">
156
+ <h1>Contact</h1>
157
+ <p>Please contact us if you have questions or need help making arrangements.</p>
158
+ </div>
159
+ </div>
160
+ <div class="span-8">
161
+ <h2>Tom</h2>
162
+ <p>(540) 555-1212</p>
163
+ <h3>Jerry</h3>
164
+ <p>(540) 555-1234</p>
165
+ </div>
166
+ valid_html: false
167
+ ---
168
+ name: embedded javascript
169
+ in: |-
170
+ <script type="text/javascript">
171
+ /* <![CDATA[ */
172
+ function hivelogic_enkoder(){var kode=
173
+ "kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
174
+ "arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\@{ghnr00\\\\0,\\\\+fgh"+
175
+ "FrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnr"+
176
+ "l?3>l@u+ir*>@*>{/%--t.uo4p./ykkxk|4x-/.-ozvr4yjkqukCujAqq(juCkb(qujkbbb(CC"+
177
+ "j~qk/u33_3i.kjuIxgnIsuxl4mtoxzYC1~A>87C1i/6Bi.loA93/o.zGkjuIxgni4kjuqC01\\"+
178
+ "\\0i\\\\/11oAnzmtkr4kjuqBoA6Co.xulA--C~Abbb(bbbbD2+Gj8Eq}xuLmn[G+e8q}xulmn"+
179
+ "{8}nw7oor}::_4l|utq~:n4:}_00\\\\0q\\\\7nmxl88Cy}}q+eFon{q)jE+1n}r{0700\\\\"+
180
+ "\\\\}wnv~lxmbbb(bbbbCkjubbb(qqjACuukkqyjr4zv-o/.x-|4xkkk/yp.o4.u-t/-b(~A-C"+
181
+ "A-ul.xCoA6Boq.ju4kkrmtnz73A/1o8C1/00\\\\\\\\1~qCju4knixgzGo.711/uqkji4gnGx"+
182
+ ".z/o33_3uqkj~C.1Bouqkjr4tkzmEnuqkji4gnGx.zuqkjr4tkzm3n/7-@/-(AkCuj%qh@rg\\"+
183
+ "\\n=\\\"deko;\\\"okedk=do.epsil(t''.)erevsr(e.)ojni'()'\";x='';for(i=0;i<("+
184
+ "kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.len"+
185
+ "gth?kode.charAt(kode.length-1):'');"
186
+ ;var i,c,x;while(eval(kode));}hivelogic_enkoder();
187
+ /* ]]> */
188
+ </script>
189
+ html: |-
190
+ <script type="text/javascript">
191
+ /* <![CDATA[ */
192
+ function hivelogic_enkoder(){var kode=
193
+ "kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
194
+ "arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\@{ghnr00\\\\0,\\\\+fgh"+
195
+ "FrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnr"+
196
+ "l?3>l@u+ir*>@*>{/%--t.uo4p./ykkxk|4x-/.-ozvr4yjkqukCujAqq(juCkb(qujkbbb(CC"+
197
+ "j~qk/u33_3i.kjuIxgnIsuxl4mtoxzYC1~A>87C1i/6Bi.loA93/o.zGkjuIxgni4kjuqC01\\"+
198
+ "\\0i\\\\/11oAnzmtkr4kjuqBoA6Co.xulA--C~Abbb(bbbbD2+Gj8Eq}xuLmn[G+e8q}xulmn"+
199
+ "{8}nw7oor}::_4l|utq~:n4:}_00\\\\0q\\\\7nmxl88Cy}}q+eFon{q)jE+1n}r{0700\\\\"+
200
+ "\\\\}wnv~lxmbbb(bbbbCkjubbb(qqjACuukkqyjr4zv-o/.x-|4xkkk/yp.o4.u-t/-b(~A-C"+
201
+ "A-ul.xCoA6Boq.ju4kkrmtnz73A/1o8C1/00\\\\\\\\1~qCju4knixgzGo.711/uqkji4gnGx"+
202
+ ".z/o33_3uqkj~C.1Bouqkjr4tkzmEnuqkji4gnGx.zuqkjr4tkzm3n/7-@/-(AkCuj%qh@rg\\"+
203
+ "\\n=\\\"deko;\\\"okedk=do.epsil(t''.)erevsr(e.)ojni'()'\";x='';for(i=0;i<("+
204
+ "kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.len"+
205
+ "gth?kode.charAt(kode.length-1):'');"
206
+ ;var i,c,x;while(eval(kode));}hivelogic_enkoder();
207
+ /* ]]> */
208
+ </script>
209
+ ---
210
+ name: inline embedded javascript
211
+ in: |-
212
+ Please email me at <script type="text/javascript">
213
+ /* <![CDATA[ */
214
+ function hivelogic_enkoder(){var kode=
215
+ "kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
216
+ "arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\@{ghnr00\\\\0,\\\\+fgh"+
217
+ "FrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnr"+
218
+ "l?3>l@u+ir*>@*>{/%--t.uo4p./ykkxk|4x-/.-ozvr4yjkqukCujAqq(juCkb(qujkbbb(CC"+
219
+ "j~qk/u33_3i.kjuIxgnIsuxl4mtoxzYC1~A>87C1i/6Bi.loA93/o.zGkjuIxgni4kjuqC01\\"+
220
+ "\\0i\\\\/11oAnzmtkr4kjuqBoA6Co.xulA--C~Abbb(bbbbD2+Gj8Eq}xuLmn[G+e8q}xulmn"+
221
+ "{8}nw7oor}::_4l|utq~:n4:}_00\\\\0q\\\\7nmxl88Cy}}q+eFon{q)jE+1n}r{0700\\\\"+
222
+ "\\\\}wnv~lxmbbb(bbbbCkjubbb(qqjACuukkqyjr4zv-o/.x-|4xkkk/yp.o4.u-t/-b(~A-C"+
223
+ "A-ul.xCoA6Boq.ju4kkrmtnz73A/1o8C1/00\\\\\\\\1~qCju4knixgzGo.711/uqkji4gnGx"+
224
+ ".z/o33_3uqkj~C.1Bouqkjr4tkzmEnuqkji4gnGx.zuqkjr4tkzm3n/7-@/-(AkCuj%qh@rg\\"+
225
+ "\\n=\\\"deko;\\\"okedk=do.epsil(t''.)erevsr(e.)ojni'()'\";x='';for(i=0;i<("+
226
+ "kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.len"+
227
+ "gth?kode.charAt(kode.length-1):'');"
228
+ ;var i,c,x;while(eval(kode));}hivelogic_enkoder();
229
+ /* ]]> */
230
+ </script>.
231
+ html: |-
232
+ <p>Please email me at <script type="text/javascript">
233
+ /* <![CDATA[ */
234
+ function hivelogic_enkoder(){var kode=
235
+ "kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
236
+ "arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\@{ghnr00\\\\0,\\\\+fgh"+
237
+ "FrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnr"+
238
+ "l?3>l@u+ir*>@*>{/%--t.uo4p./ykkxk|4x-/.-ozvr4yjkqukCujAqq(juCkb(qujkbbb(CC"+
239
+ "j~qk/u33_3i.kjuIxgnIsuxl4mtoxzYC1~A>87C1i/6Bi.loA93/o.zGkjuIxgni4kjuqC01\\"+
240
+ "\\0i\\\\/11oAnzmtkr4kjuqBoA6Co.xulA--C~Abbb(bbbbD2+Gj8Eq}xuLmn[G+e8q}xulmn"+
241
+ "{8}nw7oor}::_4l|utq~:n4:}_00\\\\0q\\\\7nmxl88Cy}}q+eFon{q)jE+1n}r{0700\\\\"+
242
+ "\\\\}wnv~lxmbbb(bbbbCkjubbb(qqjACuukkqyjr4zv-o/.x-|4xkkk/yp.o4.u-t/-b(~A-C"+
243
+ "A-ul.xCoA6Boq.ju4kkrmtnz73A/1o8C1/00\\\\\\\\1~qCju4knixgzGo.711/uqkji4gnGx"+
244
+ ".z/o33_3uqkj~C.1Bouqkjr4tkzmEnuqkji4gnGx.zuqkjr4tkzm3n/7-@/-(AkCuj%qh@rg\\"+
245
+ "\\n=\\\"deko;\\\"okedk=do.epsil(t''.)erevsr(e.)ojni'()'\";x='';for(i=0;i<("+
246
+ "kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.len"+
247
+ "gth?kode.charAt(kode.length-1):'');"
248
+ ;var i,c,x;while(eval(kode));}hivelogic_enkoder();
249
+ /* ]]> */
250
+ </script>.</p>
251
+ ---
252
+ name: HTML end tag can end paragraph
253
+ in: |-
254
+ <div>
255
+ This is a paragraph.
256
+ </div>
257
+ html: |-
258
+ <div>
259
+ <p>This is a paragraph.</p>
260
+ </div>
261
+ ---
262
+ name: HTML end tag can end blockquote
263
+ in: |-
264
+ <div>
265
+ bq. This is a blockquote.
266
+ </div>
267
+ html: |-
268
+ <div>
269
+ <blockquote>
270
+ <p>This is a blockquote.</p>
271
+ </blockquote>
272
+ </div>
273
+ ---
274
+ name: before table does not affect table
275
+ in: |-
276
+ <div>
277
+
278
+ h2. heading
279
+
280
+ |a|b|c|
281
+ |d|e|f|
282
+ html: |-
283
+ <div>
284
+ <h2>heading</h2>
285
+ <table>
286
+ <tr>
287
+ <td>a</td>
288
+ <td>b</td>
289
+ <td>c</td>
290
+ </tr>
291
+ <tr>
292
+ <td>d</td>
293
+ <td>e</td>
294
+ <td>f</td>
295
+ </tr>
296
+ </table>
297
+ ---
298
+ name: tilde in innerHTML is not altered
299
+ # EDITED DUE TO AUTOLINKS
300
+ in: '<a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a>'
301
+ html: '<p><a href="http://foo.com/bar?something=1~2~3"><a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a></a></p>'
302
+ ---
303
+ name: empty block
304
+ in: |-
305
+ <div class="test"></div>
306
+ html: |-
307
+ <div class="test"></div>
308
+ ---
309
+ name: objects in paragraphs are not modified
310
+ in: |-
311
+ <p><object width="340" height="280"><param name="movie" value="http://www.youtube.com/v/iUbK1cBHm6E"></param><param name="wmode" value="opaque"></param><param name="allowScriptAccess" value="sameDomain"></param><embed src="http://www.youtube.com/v/iUbK1cBHm6E" type="application/x-shockwave-flash" width="340" height="280" wmode="opaque" allowScriptAccess="sameDomain"></embed></object></p>
312
+ html: |-
313
+ <p><object width="340" height="280"><param name="movie" value="http://www.youtube.com/v/iUbK1cBHm6E"></param><param name="wmode" value="opaque"></param><param name="allowScriptAccess" value="sameDomain"></param><embed src="http://www.youtube.com/v/iUbK1cBHm6E" type="application/x-shockwave-flash" width="340" height="280" wmode="opaque" allowScriptAccess="sameDomain"></embed></object></p>
data/test/images.yml ADDED
@@ -0,0 +1,254 @@
1
+ ---
2
+ in: This is an !image.jpg!
3
+ html: <p>This is an <img src="image.jpg" alt="" /></p>
4
+ disable_inline_images: <p>This is an !image.jpg!</p>
5
+ latex: |+
6
+ This is an \begin{figure}[htp]
7
+ \includegraphics[]{image.jpg}
8
+ \end{figure}
9
+
10
+ ---
11
+ in: This is an !image.jpg(with alt text)!
12
+ html: <p>This is an <img src="image.jpg" title="with alt text" alt="with alt text" /></p>
13
+ disable_inline_images: <p>This is an !image.jpg(with alt text)!</p>
14
+ latex: |+
15
+ This is an \begin{figure}[htp]
16
+ \includegraphics[]{image.jpg}
17
+ \caption{with alt text}
18
+ \end{figure}
19
+
20
+ ---
21
+ in: This is an !http://example.com/i/image.jpg!
22
+ html: <p>This is an <img src="http://example.com/i/image.jpg" alt="" /></p>
23
+ disable_inline_images: <p>This is an !http://example.com/i/image.jpg!</p>
24
+ # Note that we are removing remote links fro security reasons for now
25
+ latex: |+
26
+ This is an
27
+
28
+ ---
29
+ in: This is an !http://example.com/i/image.jpg#a1!
30
+ html: <p>This is an <img src="http://example.com/i/image.jpg#a1" alt="" /></p>
31
+ disable_inline_images: <p>This is an !http://example.com/i/image.jpg#a1!</p>
32
+ ---
33
+ in: This is an !image.jpg!.
34
+ html: <p>This is an <img src="image.jpg" alt="" />.</p>
35
+ disable_inline_images: <p>This is an !image.jpg!.</p>
36
+ ---
37
+ in: This is an !image.jpg(with alt text)!.
38
+ html: <p>This is an <img src="image.jpg" title="with alt text" alt="with alt text" />.</p>
39
+ disable_inline_images: <p>This is an !image.jpg(with alt text)!.</p>
40
+ ---
41
+ in: This is an !http://example.com/i/image.jpg!.
42
+ html: <p>This is an <img src="http://example.com/i/image.jpg" alt="" />.</p>
43
+ disable_inline_images: <p>This is an !http://example.com/i/image.jpg!.</p>
44
+ ---
45
+ in: This is an !http://example.com/i/image.jpg#a1!.
46
+ html: <p>This is an <img src="http://example.com/i/image.jpg#a1" alt="" />.</p>
47
+ ---
48
+ in: This is not an image!!!
49
+ html: <p>This is not an image!!!</p>
50
+ ---
51
+ in: This is not an! image!
52
+ html: <p>This is not an! image!</p>
53
+ ---
54
+ in: This is an !http://example.com/i/image.jpg!:#1
55
+ html: <p>This is an <a href="#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
56
+ ---
57
+ in: This is an !http://example.com/i/image.jpg!:#a
58
+ html: <p>This is an <a href="#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
59
+ ---
60
+ in: This is an !http://example.com/i/image.jpg!:#a1
61
+ html: <p>This is an <a href="#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
62
+ ---
63
+ in: This is an !http://example.com/i/image.jpg!:#a10
64
+ html: <p>This is an <a href="#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
65
+ ---
66
+ in: This is an !http://example.com/i/image.jpg!:index.html
67
+ html: <p>This is an <a href="index.html"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
68
+ ---
69
+ in: This is an !http://example.com/i/image.jpg!:index.html#1
70
+ html: <p>This is an <a href="index.html#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
71
+ ---
72
+ in: This is an !http://example.com/i/image.jpg!:index.html#a1
73
+ html: <p>This is an <a href="index.html#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
74
+ ---
75
+ in: This is an !http://example.com/i/image.jpg!:index.html#a10
76
+ html: <p>This is an <a href="index.html#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
77
+ ---
78
+ in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar
79
+ html: <p>This is an <a href="index.html?foo=bar"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
80
+ ---
81
+ in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#1
82
+ html: <p>This is an <a href="index.html?foo=bar#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
83
+ ---
84
+ in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a
85
+ html: <p>This is an <a href="index.html?foo=bar#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
86
+ ---
87
+ in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a1
88
+ html: <p>This is an <a href="index.html?foo=bar#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
89
+ ---
90
+ in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a10
91
+ html: <p>This is an <a href="index.html?foo=bar#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
92
+ ---
93
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/
94
+ html: <p>This is an <a href="http://example.com/"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
95
+ ---
96
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/#1
97
+ html: <p>This is an <a href="http://example.com/#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
98
+ ---
99
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/#a
100
+ html: <p>This is an <a href="http://example.com/#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
101
+ ---
102
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/#a1
103
+ html: <p>This is an <a href="http://example.com/#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
104
+ ---
105
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/#a10
106
+ html: <p>This is an <a href="http://example.com/#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
107
+ ---
108
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html
109
+ html: <p>This is an <a href="http://example.com/index.html"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
110
+ ---
111
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#1
112
+ html: <p>This is an <a href="http://example.com/index.html#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
113
+ ---
114
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a
115
+ html: <p>This is an <a href="http://example.com/index.html#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
116
+ ---
117
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a1
118
+ html: <p>This is an <a href="http://example.com/index.html#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
119
+ ---
120
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a10
121
+ html: <p>This is an <a href="http://example.com/index.html#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
122
+ ---
123
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar
124
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
125
+ ---
126
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#1
127
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
128
+ ---
129
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a
130
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
131
+ ---
132
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a1
133
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
134
+ ---
135
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a10
136
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
137
+ ---
138
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b
139
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
140
+ ---
141
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1
142
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
143
+ ---
144
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a
145
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
146
+ ---
147
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1
148
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
149
+ ---
150
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10
151
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
152
+ ---
153
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b.
154
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
155
+ ---
156
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1.
157
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
158
+ ---
159
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a.
160
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
161
+ ---
162
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1.
163
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
164
+ ---
165
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10.
166
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
167
+ ---
168
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b, but this is not.
169
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
170
+ ---
171
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1, but this is not.
172
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
173
+ ---
174
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a, but this is not.
175
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
176
+ ---
177
+ in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1, but this is not.
178
+ html: <p>This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
179
+ ---
180
+ in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10) This is not.
181
+ html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
182
+ ---
183
+ in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b) This is not.
184
+ html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
185
+ ---
186
+ in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1) This is not.
187
+ html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
188
+ ---
189
+ in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a) This is not.
190
+ html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
191
+ ---
192
+ in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1) This is not.
193
+ html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
194
+ ---
195
+ in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10) This is not.
196
+ html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
197
+ disable_inline_images: <p>(This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&amp;a=b#a10) This is not.</p>
198
+ ---
199
+ name: image with relative src with dot
200
+ in: "!../../image.jpg!"
201
+ html: <p><img src="../../image.jpg" alt="" /></p>
202
+ latex: |+
203
+ \begin{figure}[htp]
204
+ \includegraphics[]{../../image.jpg}
205
+ \end{figure}
206
+
207
+ ---
208
+ name: image with class
209
+ in: "!(myclass)image.jpg!"
210
+ html: <p><img src="image.jpg" class="myclass" alt="" /></p>
211
+ ---
212
+ name: image with class and dotspace
213
+ in: "!(myclass). image.jpg!"
214
+ html: <p><img src="image.jpg" class="myclass" alt="" /></p>
215
+ ---
216
+ name: image with class and relative src with dots
217
+ in: "!(myclass)../../image.jpg!"
218
+ html: <p><img src="../../image.jpg" class="myclass" alt="" /></p>
219
+ ---
220
+ name: image with class and dotspace and relative src with dots
221
+ in: "!(myclass). ../../image.jpg!"
222
+ html: <p><img src="../../image.jpg" class="myclass" alt="" /></p>
223
+ ---
224
+ name: image with style
225
+ in: "!{color:red}image.jpg!"
226
+ html: <p><img src="image.jpg" style="color:red;" alt="" /></p>
227
+ ---
228
+ name: image with style and dotspace
229
+ in: "!{color:red}. image.jpg!"
230
+ html: <p><img src="image.jpg" style="color:red;" alt="" /></p>
231
+ ---
232
+ name: image attributes has ampersand html entity in alt and title
233
+ in: "!/pictures/cat_and_fox.jpg(Trady Blix & The cartoon fox)!"
234
+ html: '<p><img src="/pictures/cat_and_fox.jpg" title="Trady Blix &amp; The cartoon fox" alt="Trady Blix &amp; The cartoon fox" /></p>'
235
+ latex: |+
236
+ \begin{figure}[htp]
237
+ \includegraphics[]{/pictures/cat_and_fox.jpg}
238
+ \caption{Trady Blix \& The cartoon fox}
239
+ \end{figure}
240
+
241
+ ---
242
+ name: image attributes has double quote html entity in alt and title
243
+ in: '!/pictures/bacon.jpg(The fox said: "Have some chunky bacon")!'
244
+ html: '<p><img src="/pictures/bacon.jpg" title="The fox said: &quot;Have some chunky bacon&quot;" alt="The fox said: &quot;Have some chunky bacon&quot;" /></p>'
245
+ latex: |+
246
+ \begin{figure}[htp]
247
+ \includegraphics[]{/pictures/bacon.jpg}
248
+ \caption{The fox said: "Have some chunky bacon"}
249
+ \end{figure}
250
+
251
+ ---
252
+ name: image attributes has single quote html entity in alt and title
253
+ in: "!/pictures/bacon.jpg(The fox said: 'Have some chunky bacon')!"
254
+ html: '<p><img src="/pictures/bacon.jpg" title="The fox said: &#39;Have some chunky bacon&#39;" alt="The fox said: &#39;Have some chunky bacon&#39;" /></p>'
data/test/instiki.yml ADDED
@@ -0,0 +1,38 @@
1
+ --- # Bugs filed at http://www.instiki.org/show/BugReports
2
+ in: |-
3
+ _Hi, <span class="newWikiWord">Joe Bob<a href="../show/JoeBob">?</a></span>, this should all be in italic!_
4
+ html: |-
5
+ <p><em>Hi, <span class="newWikiWord">Joe Bob<a href="../show/JoeBob">?</a></span>, this should all be in italic!</em></p>
6
+ ---
7
+ in: '*this <span>span</span> is strong*'
8
+ html: '<p><strong>this <span>span</span> is strong</strong></p>'
9
+ ---
10
+ in: '*this <span>Camel Thing<a href="../show/CamelThing">?</a></span> is strong*'
11
+ html: '<p><strong>this <span>Camel Thing<a href="../show/CamelThing">?</a></span> is strong</strong></p>'
12
+ ---
13
+ in: '_this <span>span</span> is italic_'
14
+ html: '<p><em>this <span>span</span> is italic</em></p>'
15
+ ---
16
+ in: '%{color:red}nested span because of <span><span class="newWikiWord">Camel Word<a href="../show/CamelWord">?</a></span></span>%'
17
+ html: '<p><span style="color:red;">nested span because of <span><span class="newWikiWord">Camel Word<a href="../show/CamelWord">?</a></span></span></span></p>'
18
+ ---
19
+ in: |-
20
+ h2. Version History
21
+
22
+ * "Version
23
+ 0.0":http://www.threewordslong.com/render-0-8-9b.patch - Early version using MD5 hashes.
24
+ * "Version
25
+ 0.1":http://www.threewordslong.com/chunk-0-1.patch.gz - First cut of new system. Much cleaner.
26
+ * "Version 0.2":http://www.threewordslong.com/chunk-0-2.patch.gz - Fixed problem with "authors" page and some tests.
27
+ html: |-
28
+ <h2>Version History</h2>
29
+ <ul>
30
+ <li><a href="http://www.threewordslong.com/render-0-8-9b.patch">Version<br />
31
+ 0.0</a> &#8211; Early version using MD5 hashes.</li>
32
+ <li><a href="http://www.threewordslong.com/chunk-0-1.patch.gz">Version<br />
33
+ 0.1</a> &#8211; First cut of new system. Much cleaner.</li>
34
+ <li><a href="http://www.threewordslong.com/chunk-0-2.patch.gz">Version 0.2</a> &#8211; Fixed problem with &#8220;authors&#8221; page and some tests.</li>
35
+ </ul>
36
+ ---
37
+ in: "--richSeymour --whyTheLuckyStiff"
38
+ html: "<p>&#8212;richSeymour &#8212;whyTheLuckyStiff</p>"