Using carriage returns inside shortcode brackets really messes things up
-
WordPress 5.4.1
Display Posts Version 3.0.2This an FYI, not a support request.
While setting up a new list I was experimenting with options. To keep things simple and readable I began to use linefeeds to format the attributes in the shortcode. Using linefeeds in the shortcode generates odd results.
The confusing thing is that a lot of things continue to work but some things break. This threw up some red-herrings, fortunately I didn’t need to do too much testing before I found the problem.
When using linefeeds within the shortcode seems as though the value for some specified attributes is over-ridden with an empty value. When that happens the CSS inheritance chain is broken and stuff gets ugly.
I didn’t see anything in the Shortcode API that prohibits the use of linefeed or carriage return when calling shortcodes.
If your plugin shortcode was able to treat linefeeds and carriage returns as white space it would be more robust.
- The topic ‘Using carriage returns inside shortcode brackets really messes things up’ is closed to new replies.