Commit f290be6b2a for wordpress.org

commit f290be6b2abef4a382bb84c4feeea0fa76b8d012
Author: adamsilverstein <adamsilverstein@git.wordpress.org>
Date:   Thu Sep 17 17:36:27 2026 +0000

    Formatting: Prevent `wpautop()` moving a paragraph into an attribute of a blockquote.

    Props johnbillion, westonruter, jonsurrell, joehoyle, dmsnell, xknown, jorbin, jeremyfelt, rafiem.


    Built from https://develop.svn.wordpress.org/trunk@63665


    git-svn-id: http://core.svn.wordpress.org/trunk@62839 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index abbf18c3b7..5bf001c430 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -560,7 +560,7 @@ function wpautop( $text, $br = true ) {
 	$text = preg_replace( '|<p>(<li.+?)</p>|', '$1', $text );

 	// If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
-	$text = preg_replace( '|<p><blockquote([^>]*)>|i', '<blockquote$1><p>', $text );
+	$text = preg_replace( '!<p><blockquote((?:[^>"\']|"[^"]*"|\'[^\']*\')*)>!i', '<blockquote$1><p>', $text );
 	$text = str_replace( '</blockquote></p>', '</p></blockquote>', $text );

 	// If an opening or closing block element tag is preceded by an opening <p> tag, remove it.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index c7d6a7e452..edd993a416 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-alpha-63663';
+$wp_version = '7.2-alpha-63665';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.