[wp-trac] [WordPress Trac] #19484: Shortcode skipping when using two different types for same keyword.
WordPress Trac
wp-trac at lists.automattic.com
Fri Dec 9 03:38:00 UTC 2011
#19484: Shortcode skipping when using two different types for same keyword.
--------------------------+-----------------------------
Reporter: raguay | Owner: raguay
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Shortcodes | Version: 3.3
Severity: normal | Keywords:
--------------------------+-----------------------------
I am writing a shortcode that has an open and closed format. What I mean
by that is: open format is when you use a short code to open and close
the content. Example: "{{{[highlight lang='HTML'] <some html>
[/highlight]}}}". Closed format is when you just use the shortcode
without incorporating anything else. Example: "{{{[highlight lang='HTML'
name='test']}}}" and it pulls the named script from the html database for
highlighting. If you only use one format in a page, it does fine. But
when you mix them, it does not properly work. For example:
{{{
[highlight lang='HTML' name='test']
<some html>
[highlight lang='HTML']
<some html to be highlighted>
[/highlight]
}}}
The above example will always remove any content from the first shortcode
to the closure shortcode thinking that the closure is for the first
shortcode only. The shortcode code should reset with the second shortcode
defined and assume the first one does not have a closure shortcode. If
you reverse the order of the shortcodes, it will work fine, but that is
not always the usage case.
I have test this in 2.8 through 3.3 rc1. I also could not find anything
like this reported in the existing tickets. Most likely no one has tried
to do anything like this before. I guess I could make it more than one
shortcode, but I like the flexibility of the this format.
Richard Guay
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19484>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list