| | 403 | |
| | 404 | /** |
| | 405 | * wpautop() should ignore spaced content in blocks without line breaks |
| | 406 | * |
| | 407 | * @ticket 18136 |
| | 408 | */ |
| | 409 | function test_spacing_in_blocks() { |
| | 410 | $str = "<div><p>123</p> </div>"; |
| | 411 | $this->assertEquals( "<div>\n<p>123</p>\n </div>", trim( wpautop( $str ) ) ); |
| | 412 | } |
| | 413 | |
| | 414 | /** |
| | 415 | * wpautop() should ignore content without line breaks |
| | 416 | * |
| | 417 | * @ticket 20444 |
| | 418 | */ |
| | 419 | function test_unbroken_lines() { |
| | 420 | $str = "<div><p>Hello world</p><span>WordPress</span></div>"; |
| | 421 | $this->assertEquals( "<div>\n<p>Hello world</p>\n<span>WordPress</span></div>", trim( wpautop( $str ) ) ); |
| | 422 | } |
| | 423 | |
| | 424 | /** |
| | 425 | * wpautop() should correctly pee in blocks |
| | 426 | * |
| | 427 | * @ticket 27350 |
| | 428 | */ |
| | 429 | function test_pee_in_divs() { |
| | 430 | $str = "<div>hello\n<pre>test</pre>\nworld</div>"; |
| | 431 | $this->assertEquals( $str, trim( wpautop( $str ) ) ); |
| | 432 | |
| | 433 | $str = "hello<div>test</div>"; |
| | 434 | $expected = "hello\n<div>test</div>"; // becuase of formatting.php ~ line 391: $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); |
| | 435 | $this->assertEquals( $expected, trim( wpautop( $str ) ) ); |
| | 436 | } |