Make WordPress Core


Ignore:
Timestamp:
11/17/2005 05:47:29 PM (20 years ago)
Author:
ryan
Message:

Big tiny fixes from skeltoac. fixes #1897

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-formatting.php

    r3114 r3136  
    6363    $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
    6464    $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
    65     $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t<p>$1</p>\n", $pee); // make paragraphs, including one at the end
     65    $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
    6666    $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
    6767    $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
     
    994994}
    995995
     996function wp_richedit_pre($text) {
     997    // Filtering a blank results in an annoying <br />\n
     998    if ( empty($text) ) return '';
     999
     1000    $output = $text;
     1001    $output = html_entity_decode($output); // undoes format_to_edit()
     1002    $output = wptexturize($output);
     1003    $output = convert_chars($output);
     1004    $output = wpautop($output);
     1005
     1006    // These must be double-escaped or planets will collide.
     1007    $output = str_replace('&lt;', '&amp;lt;', $output);
     1008    $output = str_replace('&gt;', '&amp;gt;', $output);
     1009
     1010    return $output;
     1011}
     1012
    9961013?>
Note: See TracChangeset for help on using the changeset viewer.