diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index 12e5bee017..e2c8aef269 100644
|
a
|
b
|
function wpautop( $pee, $br = true ) { |
| 500 | 500 | // Add a double line break below block-level closing tags. |
| 501 | 501 | $pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee ); |
| 502 | 502 | |
| | 503 | // Add a double line break after hr tags, which are self closing. |
| | 504 | $pee = preg_replace( '!(<hr\s*?/?>)!', "$1\n\n", $pee ); |
| | 505 | |
| 503 | 506 | // Standardize newline characters to "\n". |
| 504 | 507 | $pee = str_replace( array( "\r\n", "\r" ), "\n", $pee ); |
| 505 | 508 | |
diff --git a/tests/phpunit/tests/formatting/Autop.php b/tests/phpunit/tests/formatting/Autop.php
index 3f44949fe2..405b68ad34 100644
|
a
|
b
|
Paragraph two.'; |
| 312 | 312 | 'h4', |
| 313 | 313 | 'h5', |
| 314 | 314 | 'h6', |
| 315 | | 'hr', |
| 316 | 315 | 'fieldset', |
| 317 | 316 | 'legend', |
| 318 | 317 | 'section', |
| … |
… |
line 2<br/> |
| 558 | 557 | $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) ); |
| 559 | 558 | } |
| 560 | 559 | |
| | 560 | /** |
| | 561 | * @ticket 14674 |
| | 562 | */ |
| | 563 | function test_the_hr_is_not_peed() { |
| | 564 | $content = 'paragraph1<hr>paragraph2'; |
| | 565 | $expected = "<p>paragraph1</p>\n<hr>\n<p>paragraph2</p>"; |
| | 566 | |
| | 567 | $this->assertEquals( $expected, trim( wpautop( $content ) ) ); |
| | 568 | } |
| 561 | 569 | } |