Skip to content

Commit 471ed03

Browse files
authored
Merge pull request #120 from blksh3p/119-youtube-space-issue
fixed youtube regex #119
2 parents aebea4a + 48a278f commit 471ed03

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/embed",
3-
"version": "2.8.0",
3+
"version": "2.8.1",
44
"keywords": [
55
"codex editor",
66
"embed",

src/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const SERVICES: ServicesConfigType = {
1313
},
1414
youtube: {
1515
regex:
16-
/(?:https?:\/\/)?(?:www\.)?(?:(?:youtu\.be\/)|(?:youtube\.com)\/(?:v\/|u\/\w\/|embed\/|watch|shorts\/))(?:(?:\?v=)?([^#&?=]*))?((?:[?&]\w*=\w*)*)/,
16+
/(?:https?:\/\/)?(?:www\.)?(?:(?:youtu\.be\/)|(?:youtube\.com)\/(?:v\/|u\/\w\/|embed\/|watch|shorts\/))(?:(?:\?v=)?([^#&?=]*))?((?:[?&]\w*=[\w%+]*)*)/,
1717
embedUrl: 'https://www.youtube.com/embed/<%= remote_id %>',
1818
html: '<iframe style="width:100%;" height="320" frameborder="0" allowfullscreen></iframe>',
1919
height: 320,

test/services.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ describe('Services Regexps', () => {
6060
source: 'https://youtube.com/shorts/AAcP_D8fz5c?si=79yc6fwUcvsL-FY_',
6161
embed: 'https://www.youtube.com/embed/AAcP_D8fz5c?',
6262
},
63+
{
64+
source: 'https://www.youtube.com/watch?v=kU9y8rKCe3w&ab_channel=Well%2BGood',
65+
embed: 'https://www.youtube.com/embed/kU9y8rKCe3w?',
66+
},
6367
];
6468

6569
urls.forEach((url) => {

0 commit comments

Comments
 (0)