Changeset 2358 for trunk/system/helpers/text.php
- Timestamp:
- 03/27/2008 05:22:57 AM (8 months ago)
- Files:
-
- 1 modified
-
trunk/system/helpers/text.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/helpers/text.php
r2352 r2358 222 222 public static function auto_link($text) 223 223 { 224 // Auto link emails first to prevent problems with "www.domain.com@example.com" 224 225 return text::auto_link_urls(text::auto_link_emails($text)); 225 226 } … … 303 304 // Some html elements should not be surrounded by <p> tags 304 305 $no_p = '(?:p|div|h[1-6r]|[uod]l|pre|blockquote|table|form|style)'; 305 $str = preg_replace('~<p>(?= <'.$no_p.'[^>]*+>)~i', '', $str);306 return preg_replace('~(</'.$no_p.'> )</p>~i', '$1', $str);306 $str = preg_replace('~<p>(?=\s*+<'.$no_p.'[^>]*+>)~i', '', $str); 307 return preg_replace('~(</'.$no_p.'>\s*+)</p>~i', '$1', $str); 307 308 } 308 309
