[wp-trac] Re: [WordPress Trac] #6877: preg_replace in wpautop deletes all the text in the post

WordPress Trac wp-trac at lists.automattic.com
Tue May 6 07:39:15 GMT 2008


#6877: preg_replace in wpautop deletes all the text in the post
-----------------------------------------+----------------------------------
 Reporter:  duncanmc                     |        Owner:  anonymous
     Type:  defect                       |       Status:  new      
 Priority:  highest omg bbq              |    Milestone:  2.5.2    
Component:  Administration               |      Version:  2.5.1    
 Severity:  critical                     |   Resolution:           
 Keywords:  reporter-feedback , wpautop  |  
-----------------------------------------+----------------------------------
Comment (by azaozz):

 Maybe we can try "Atomic Grouping" to reduce the backtracking:
 http://www.regular-expressions.info/atomic.html

 The regexp would look something like this:
 {{{
 $pee = preg_replace('/\n?(.+?)(?>\n\s*\n|\z)/s', "<p>$1</p>\n", $pee);
 }}}
 (the only change would be replacing : with >).

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6877#comment:5>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list