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

WordPress Trac wp-trac at lists.automattic.com
Mon Feb 21 12:53:19 UTC 2011

#14050: shortcode_unautop() should also remove the <br /> added after shortcodes
 Reporter:  aaroncampbell                        |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Formatting                           |  Release
 Severity:  normal                               |     Version:  3.0
 Keywords:  has-patch dev-feedback needs-        |  Resolution:
  testing needs-unit-tests 3.2-early             |

Comment (by bobbingwide):

 Hi, I'm new to this Trac system but I have a couple of comments.
 1. This problem is documented as having been fixed in WP 2.5.1.

 extract from http://codex.wordpress.org/Shortcode_API#Output

 wpautop recognizes shortcode syntax and will attempt not to wrap p or br
 tags around shortcodes that stand alone on a line by themselves.
 Shortcodes intended for use in this manner should ensure that the output
 is wrapped in an appropriate block tag such as <p> or <div>.

 Note: in WordPress 2.5.0, shortcodes were parsed before post formatting
 was applied, so the shortcode output HTML was sometimes wrapped in p or br
 tags. This was incorrect behaviour that has been fixed in 2.5.1.

 2. Shouldn't someone update the above text to say it's still a problem? Or
 is there some etiquette that says WordPress should not air its dirty
 3. I've applied the fix and it's fine for me.
 4. I'm not sure if I agree with the comments in #13340 as they suggest
 that this fix will need a lot of regression testing. I agree that there
 may be some sites that will appear to break by the removal of the unwanted
 <br />'s BUT in my opinion their continued presence is particularly
 annoying given the above documentation.
 5. I would like to see this fix as a candidate for 3.0.6 (3.2 is far too
 6. If not then I would like to see the workaround documented. Actually
 I've had a go myself. See http://www.bobbingwidewebdesign.com/2011/02/21

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

More information about the wp-trac mailing list