Make WordPress Core

Opened 11 years ago

Last modified 9 years ago

#23517 closed defect (bug)

Shortcode: if last parameter ends with '/', it is mistaken for self-closing shortcode closure — at Version 4

Reported by: sergem's profile sergem Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Shortcodes Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In example:

[shortcode urlparam=http://somesite/path/]content text[/shortcode]
"[shortcode urlparam=http://somesite/path/]" 

is interpreted as self closing:

[shortcode/] with urlparam="http://somesite/path"

All examples in http://codex.wordpress.org/Shortcode_API include whitespace before '/]'

This prevents implementation of bbcode parser for people to paste flickr photo snippets.

Change History (4)

#1 @kovshenin
11 years ago

Similar to HTML, the [shortcode/] syntax is a self-closing shortcode, and there's no easy way to distinguish that from the argument value, unless you enclose that in quotes, which should work:

[shortcode urlparam="http://somesite/path/"]

Suggesting to close as invalid.

#2 @sergem
11 years ago

  • Keywords has-patch added

#3 @sergem
11 years ago

lookbehind non-whitespace does it nicely!

#4 @SergeyBiryukov
11 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.