Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php (revision 39637)
+++ src/wp-includes/formatting.php (working copy)
@@ -474,6 +474,9 @@
// Add a double line break below block-level closing tags.
$pee = preg_replace('!(' . $allblocks . '>)!', "$1\n\n", $pee);
+ // hr's are block-level and self-closing
+ $pee = preg_replace('!(
)!', "\n\n$1\n\n", $pee );
+
// Standardize newline characters to "\n".
$pee = str_replace(array("\r\n", "\r"), "\n", $pee);
Index: tests/phpunit/tests/formatting/Autop.php
===================================================================
--- tests/phpunit/tests/formatting/Autop.php (revision 39637)
+++ tests/phpunit/tests/formatting/Autop.php (working copy)
@@ -312,7 +312,6 @@
'h4',
'h5',
'h6',
- 'hr',
'fieldset',
'legend',
'section',
@@ -534,4 +533,14 @@
$this->assertEquals( $expected, trim( wpautop( $content ) ) );
}
+
+ /**
+ * @ticket 14674
+ */
+ function test_the_hr_is_not_peed() {
+ $content = 'paragraph1
paragraph2';
+ $expected = "paragraph1
\n
\nparagraph2
";
+
+ $this->assertEquals( $expected, trim( wpautop( $content ) ) );
+ }
}