| 292 | * @ticket 23756 |
| 293 | */ |
| 294 | function test_no_links_inside_pre_or_code() { |
| 295 | $before = array( |
| 296 | '<pre>http://wordpress.org</pre>', |
| 297 | '<code>http://wordpress.org</code>', |
| 298 | '<pre class="foobar" id="foo">http://wordpress.org</pre>', |
| 299 | '<code class="foobar" id="foo">http://wordpress.org</code>', |
| 300 | '<precustomtag>http://wordpress.org</precustomtag>', |
| 301 | '<codecustomtag>http://wordpress.org</codecustomtag>', |
| 302 | 'URL before pre http://wordpress.org<pre>http://wordpress.org</pre>', |
| 303 | 'URL before code http://wordpress.org<code>http://wordpress.org</code>', |
| 304 | 'URL after pre <pre>http://wordpress.org</pre>http://wordpress.org', |
| 305 | 'URL after code <code>http://wordpress.org</code>http://wordpress.org', |
| 306 | 'URL before and after pre http://wordpress.org<pre>http://wordpress.org</pre>http://wordpress.org', |
| 307 | 'URL before and after code http://wordpress.org<code>http://wordpress.org</code>http://wordpress.org', |
| 308 | 'code inside pre <pre>http://wordpress.org <code>http://wordpress.org</code> http://wordpress.org</pre>', |
| 309 | ); |
| 310 | |
| 311 | $expected = array( |
| 312 | '<pre>http://wordpress.org</pre>', |
| 313 | '<code>http://wordpress.org</code>', |
| 314 | '<pre class="foobar" id="foo">http://wordpress.org</pre>', |
| 315 | '<code class="foobar" id="foo">http://wordpress.org</code>', |
| 316 | '<precustomtag><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a></precustomtag>', |
| 317 | '<codecustomtag><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a></codecustomtag>', |
| 318 | 'URL before pre <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><pre>http://wordpress.org</pre>', |
| 319 | 'URL before code <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><code>http://wordpress.org</code>', |
| 320 | 'URL after pre <pre>http://wordpress.org</pre><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>', |
| 321 | 'URL after code <code>http://wordpress.org</code><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>', |
| 322 | 'URL before and after pre <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><pre>http://wordpress.org</pre><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>', |
| 323 | 'URL before and after code <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><code>http://wordpress.org</code><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>', |
| 324 | 'code inside pre <pre>http://wordpress.org <code>http://wordpress.org</code> http://wordpress.org</pre>', |
| 325 | ); |
| 326 | |
| 327 | foreach ($before as $key => $url) { |
| 328 | $this->assertEquals($expected[$key], make_clickable($url)); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | /** |