Changeset 3136 for trunk/wp-includes/functions-formatting.php
- Timestamp:
- 11/17/2005 05:47:29 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions-formatting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-formatting.php
r3114 r3136 63 63 $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 64 64 $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 end65 $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end 66 66 $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace 67 67 $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 … … 994 994 } 995 995 996 function 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;', $output); 1008 $output = str_replace('>', '&gt;', $output); 1009 1010 return $output; 1011 } 1012 996 1013 ?>
Note: See TracChangeset
for help on using the changeset viewer.