[wp-trac] [WordPress Trac] #14050: shortcode_unautop() should also remove the <br /> added after shortcodes

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 22 18:15:27 UTC 2010


#14050: shortcode_unautop() should also remove the <br /> added after shortcodes
---------------------------+------------------------------------------------
 Reporter:  aaroncampbell  |       Owner:            
     Type:  defect (bug)   |      Status:  new       
 Priority:  normal         |   Milestone:  Unassigned
Component:  Formatting     |     Version:  3.0       
 Severity:  normal         |    Keywords:            
---------------------------+------------------------------------------------
 Currently `wpautop()` wraps a shortcode in `<p>` tags as well as adding a
 `<br />` tag after the shortcode. We then use `shortcode_unautop()` to
 remove the `<p>` tags, but the `<br />` stays.

 To replicate, just drop a few caption shortcodes into a post and set them
 all to align left or right. You'll see that even though they all float
 (assuming that's how your theme handles them) they stair step down because
 of the extra `<br />`

 I'm not a regex expert so someone should probably double check my patch,
 but it seems to work for me.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14050>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list