Formatting: Don't add <p> tags inside <svg> tags.

Inline `<svg>`s should generally work, as browsers should just ignore `<p>` or `<br/>` tags that shouldn't be inside the `<svg>`. To keep things neat, however, it's better not add them in the first place.

Props jared_smith, nacin, pento.
Fixes #9437.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-07-01 03:19:58 +00:00
parent 93f3335f13
commit f3ece5149f
2 changed files with 2 additions and 2 deletions

View File

@ -580,7 +580,7 @@ function wpautop( $pee, $br = true ) {
// Optionally insert line breaks.
if ( $br ) {
// Replace newlines that shouldn't be touched with a placeholder.
$pee = preg_replace_callback( '/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee );
$pee = preg_replace_callback( '/<(script|style|svg).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee );
// Normalize <br>
$pee = str_replace( array( '<br>', '<br/>' ), '<br />', $pee );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45576';
$wp_version = '5.3-alpha-45577';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.