From 55b2d94cca697ae8954a897e690156673b645469 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 2 Jul 2019 11:22:56 +0000 Subject: [PATCH] Formatting: Revert the changes to `wpautop()` in [45585,45587]. See #27350. Built from https://develop.svn.wordpress.org/trunk@45589 git-svn-id: http://core.svn.wordpress.org/trunk@45400 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 15 ++++----------- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 993c3af50e..973eb0ba78 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -492,8 +492,7 @@ 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)\b'; - $allblocksexceptp = str_replace( '|p|', '|', $allblocks ); + $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)'; // Add a double line break above block-level opening tags. $pee = preg_replace( '!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee ); @@ -559,12 +558,12 @@ function wpautop( $pee, $br = true ) { // Under certain strange conditions it could create a P of entirely whitespace. $pee = preg_replace( '|

\s*

|', '', $pee ); - // If an opening or closing block element tag is wrapped in a

, unwrap it. - $pee = preg_replace( '!

\s*(]*>)\s*

!', '$1', $pee ); - // Add a closing

inside

,
, or
tag if missing. $pee = preg_replace( '!

([^<]+)!', '

$1

', $pee ); + // If an opening or closing block element tag is wrapped in a

, unwrap it. + $pee = preg_replace( '!

\s*(]*>)\s*

!', '$1', $pee ); + // In some cases
  • may get wrapped in

    , fix them. $pee = preg_replace( '|

    (|', '$1', $pee ); @@ -578,12 +577,6 @@ function wpautop( $pee, $br = true ) { // If an opening or closing block element tag is followed by a closing

    tag, remove it. $pee = preg_replace( '!(]*>)\s*

    !', '$1', $pee ); - // If a closing

    tag is inside a block element tag, without a preceding opening

    tag, remove it. - $pee = preg_replace( '#(<(' . $allblocksexceptp . ')[^>]*>)(((?!

    |).)*)

    #s', '$1$3', $pee ); - - // If an opening

    tag is inside a block element tag, without a following closing

    tag, remove it. - $pee = preg_replace( '#

    ([^<]*(((?!

    ).)*))#s', '$1', $pee ); - // Optionally insert line breaks. if ( $br ) { // Replace newlines that shouldn't be touched with a placeholder. diff --git a/wp-includes/version.php b/wp-includes/version.php index 2508d92676..64fedc55a1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45588'; +$wp_version = '5.3-alpha-45589'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.