WordPress.org

Make WordPress Core

Ticket #21018: 21018.diff

File 21018.diff, 966 bytes (added by duck_, 22 months ago)
  • wp-includes/formatting.php

     
    236236        foreach ( $pees as $tinkle ) 
    237237                $pee .= '<p>' . trim($tinkle, "\n") . "</p>\n"; 
    238238        $pee = preg_replace('|<p>\s*</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace 
     239        $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag 
    239240        $pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>$1</p></$2>", $pee); 
    240         $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag 
    241241        $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists 
    242242        $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); 
    243243        $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);