Make WordPress Core

Ticket #3238: 3238_trunk.diff

File 3238_trunk.diff, 1.2 KB (added by Nazgul, 18 years ago)
  • wp-includes/formatting.php

     
    6969        $pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n\n", $pee);
    7070        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
    7171        $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
    72         $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
     72        $pee = preg_replace('/\n?(.+?)(?:\n\s*|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
    7373        $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
    7474        $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag
    7575        $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists