diff --git a/wp-includes/html-api/class-wp-html-tag-processor.php b/wp-includes/html-api/class-wp-html-tag-processor.php index 69e3e5d2c7..22e7c25f64 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -3877,6 +3877,17 @@ class WP_HTML_Tag_Processor { $plaintext_content ); + /* + * HTML ignores a single leading newline in this context. If a leading newline + * is intended, preserve it by adding an extra newline. + */ + if ( + 'TEXTAREA' === $this->get_tag() && + 1 === strspn( $plaintext_content, "\n\r", 0, 1 ) + ) { + $plaintext_content = "\n{$plaintext_content}"; + } + /* * These don't _need_ to be escaped, but since they are decoded it's * safe to leave them escaped and this can prevent other code from diff --git a/wp-includes/version.php b/wp-includes/version.php index 948464c9b9..ffb04ca788 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.0-beta2-61753'; +$wp_version = '7.0-beta2-61754'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.