[wp-trac] [WordPress Trac] #18311: Support HTML in image captions.
WordPress Trac
wp-trac at lists.automattic.com
Wed May 2 00:38:03 UTC 2012
#18311: Support HTML in image captions.
-----------------------------+-----------------------
Reporter: prettyboymp | Owner: sushkov
Type: task (blessed) | Status: reopened
Priority: highest omg bbq | Milestone: 3.4
Component: Editor | Version:
Severity: blocker | Resolution:
Keywords: has-patch |
-----------------------------+-----------------------
Comment (by azaozz):
Did some quick testing and seems the caption separating regex can be
optimized a bit:
{{{
preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is',
$content, $matches );
}}}
seems to be twice as fast (as there's no back tracking from the `.*?`).
The image tag + link + caption are generally not very long string but this
runs on the front-end and any speedup is good.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18311#comment:81>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list