[wp-trac] [WordPress Trac] #14481: Shortcode Enhancements
WordPress Trac
wp-trac at lists.automattic.com
Fri Aug 6 01:44:10 UTC 2010
#14481: Shortcode Enhancements
-------------------------+--------------------------------------------------
Reporter: deadowl | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Shortcodes | Version: 3.0
Severity: normal | Keywords: has-patch
-------------------------+--------------------------------------------------
Comment(by deadowl):
Replying to [comment:18 aaroncampbell]:
> I'm assuming we'd still need to keep a stack of registered shortcodes so
we can use those names in the regex? I've not a regular expressions guru
by any means (I'm fine at writing them to meet my needs, but it ends
there), so how advantageous is it to create the regex using the list of
registered shortcode names? Also, at what point (if any) does it become a
problem (what if there are 1,000 shortcodes? 10,000?)? I know that the
problems it may create are probably edge cases, but I'm curious.
The regular expression doesn't have to use the registered shortcode names
if the interpreter does the checking. The interpreter can use an
associative array, so it would generally be faster for the interpreter to
check. Using the shortcode in the regex probably takes about the same
amount of time as an in_array call as it's interpreted.
Keeping track of valid shortcodes would still be needed in interpretation
so something like [not-a-shortcode] would remain content and not be thrown
out.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14481#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list