[wp-trac] [WordPress Trac] #10376: White space should be collapsed after tags are stripped in wp_trim_excerpt

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 11 20:56:05 UTC 2009


#10376: White space should be collapsed after tags are stripped in wp_trim_excerpt
-------------------------+--------------------------------------------------
 Reporter:  sojweb       |       Owner:                                         
     Type:  enhancement  |      Status:  new                                    
 Priority:  normal       |   Milestone:  2.8.2                                  
Component:  Formatting   |     Version:  2.8.1                                  
 Severity:  normal       |    Keywords:  has-patch, the_excerpt, wp_trim_excerpt
-------------------------+--------------------------------------------------

Comment(by azaozz):

 Considering that strip_tags is run after wpautop() and the other filters
 on `'the_content'`, the pseudo-excerpt will always be one line text. If we
 want to avoid normalizing white space for the whole post, perhaps can use
 preg_split:
 {{{
 $words = preg_split('/\s+/', $text, $excerpt_length + 1,
 PREG_SPLIT_NO_EMPTY);
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10376#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list