Follow Herb Miller on Facebook Follow Herb Miller on Twitter Follow Herb Miller on LinkedIn Follow Herb Miller on GooglePlus Follow Herb Miller on YouTube

Dave Carson

I hired Herb to transform my website to WordPress. He did this for me and at the same time totally transformed my website. He has done a fantastic job and not forgetting the time he put in helping me understand how to use my new website. I would definitely recommend Herb to anyone who wants to work with someone who knows what they're talking about and who does such a brilliant job. Thank you Herb and keep up the great work. David Carson www.pcs-uk.co.uk

read more

Xandrien Thiel

I sent my website address to a lot of friends and asked feedback.I already got some good tips. And a lot of enthusiastic remarks as well. Xandrien Thiel www.balancingbyart.com

read more

Lesley Hussell

Herb is a WordPress genius, creating websites that are simple to use and do whatever the customer needs. Nothing is too much trouble – he takes great pains to make sure you understand what he's doig so you can do it too, avoids geek-speak although he's a tech wizard, and is patient and meticulous. He's a total WordPress zealot and knows countless tricks and widgets. His prices are very affordable and represent excellent value for money. An all-round good guy. Lesley Hussell - www.editingedge.co.uk

read more

Classic Car Doctor

Everyone thinks the site is great. Really professional. I've already got two new customers... one from the Bahamas. Dave the Classic Car Doctor www.classic-car-doctor.com

read more

There is a bug in WordPress associated with unwanted breaks (<br />) being created after shortcode expansion which causes formatting problems. This post attempts to document a number of possible workarounds. The bug is documented at http://core.trac.wordpress.org/ticket/14050 The current WordPress documentation for shortcodes says this bug was fixed in WordPress 2.5.1 (we’re now at version 3.0.5). Here is the relevant text
wpautop recognizes shortcode syntax and will attempt not to wrap p or br tags around shortcodes that stand alone on a line by themselves.  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.
The problem is particularly annoying to me, as I spent a couple of hours trying to work out where the extra <br />’s were coming from in my most recent post  prior to this one ( Summary of plugins in a WoW website )

Expected behaviour

Two shortcodes on the same line remain on the same line. Here we can see [ WoW] and [ oik] on the same line Here we can see WoW and oik  on the same line

Wrong behaviour

Two shortcodes on separate lines with an unwanted break [ WoW] [ oik] WoW oik

OK, this doesn’t look too bad, but in the previous post the shortcodes were formatted as table rows but all the breaks appeared before the table so there was a big vertical gap. Here, let me show you with [ bw_plug name="oik" table="y"] thrice.

Plugin name and descriptionPlugin linksVersion, total downloads, last update, tested
oik
lazy smart shortcodes for your WordPress website
oik
2.4-alpha.1012

2014-10-14 11:17:07
4.0
Plugin name and descriptionPlugin linksVersion, total downloads, last update, tested
oik
lazy smart shortcodes for your WordPress website
oik
2.4-alpha.1012

2014-10-14 11:17:07
4.0
Plugin name and descriptionPlugin linksVersion, total downloads, last update, tested
oik
lazy smart shortcodes for your WordPress website
oik
2.4-alpha.1012

2014-10-14 11:17:07
4.0

Workaround 1A

Put the shortcodes side by side: [ WoW][ oik] Put the shortcodes side by side: WoWoik

Workaround 1B

All on the same line but with spaces between them as required: [ WoW] [ oik] All on the same line but with spaces between them as required: WoW oik

Ineffective Workaround 2

If you want to write them on separate lines for ease of reading WoW oik trying leading spaces DOESN’T work.

Ineffective Workaround 3

Trying trailing required spaces doesn’t work either WoW  oik

The real solution

Either implement the fix provided by the person who found the problem. Thanks aaroncampbell

Or use the wpautop-control plugin to choose on a post by post basis whether or not you want automatic paragraphs and breaks.

One Response to shortcode breaks and WordPress bug #14050