diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index 00782b1f33..15fef0d851 100644
--- a/src/wp-includes/formatting.php
+++ b/src/wp-includes/formatting.php
@@ -492,7 +492,8 @@ function wpautop( $pee, $br = true ) {
// Change multiple
s into two line breaks, which will turn into paragraphs.
$pee = preg_replace( '|
\s*
|', "\n\n", $pee );
- $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
+ $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)\b';
+ $allblocksexceptp = str_replace( '|p|', '|', $allblocks );
// Add a double line break above block-level opening tags.
$pee = preg_replace( '!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee );
@@ -558,12 +559,12 @@ function wpautop( $pee, $br = true ) {
// Under certain strange conditions it could create a P of entirely whitespace.
$pee = preg_replace( '|
\s*
|', '', $pee ); - // Add a closinginside