mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@45577 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user