shortcode_unautop() should also remove the <br /> added after shortcodes
|Reported by:||aaroncampbell||Owned by:|
|Component:||Formatting||Keywords:||dev-feedback needs-refresh wpautop|
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.
Change History (32)
comment:9 aaroncampbell — 3 years ago
- Keywords needs-unit-tests removed
comment:10 aaroncampbell — 3 years ago
- Keywords 3.3-early added; needs-testing removed
- Milestone changed from 3.2 to Future Release
comment:16 aaroncampbell — 7 months ago
- Keywords 3.3-early removed
- Milestone changed from Future Release to 3.7