WordPress.org

Make WordPress Core

Ticket #9437: 9437.diff

File 9437.diff, 765 bytes (added by nacin, 7 years ago)
  • wp-includes/formatting.php

     
    257257        $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
    258258        $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
    259259        if ( $br ) {
    260                 $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);
     260                $pee = preg_replace_callback('/<(script|style|svg).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);
    261261                $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
    262262                $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
    263263        }