[embed] shortcode right after another

Created on 21 May 2014, almost 11 years ago
Updated 26 November 2024, 4 months ago

While working on #2269433-7: Support URLs on a line by themselves in ckeditor/WYSIWYG β†’ , I have noticed that the second [embed] shortcode does not get parsed and converted into embeded media when 2 of them are placed without any characters in between:

[embed]http://url1[/embed][embed]https://url2[/embed]

The regex optionally matches a character before and/or after the [embed] shortcode, and therefore prevents 2 of them from working as the first match 'eats' up the first character of the second shortcode:

define('OEMBED_PATTERN_EMBED_SHORTCODE', '/(.?)\[embed\b(.*?)\](.+?)\[\/embed\](.?)/s');

Does anyone know what's the (.?) are for? Do we need it? The shortcode would work even if they are one right after the other if we remove it. I haven't seen any documentation that say if this usage of shortcode should work, so I am wondering if we are going to leave it be and mark it as "by design" or fix the regex so it works?

Cheers!
sunnz

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024