Skip to content

Commit

Permalink
Merge pull request #15388 from Kocal/patch-1
Browse files Browse the repository at this point in the history
Feature (media-embed): Add support for short Dailymotion URLs (dai.ly) in media-embed.

Thanks to @Kocal!
  • Loading branch information
arkflpc authored Nov 27, 2023
2 parents dd4a5de + a8c1f60 commit da8c3ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/ckeditor5-media-embed/src/mediaembedediting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export default class MediaEmbedEditing extends Plugin {
providers: [
{
name: 'dailymotion',
url: /^dailymotion\.com\/video\/(\w+)/,
url: [
/^dailymotion\.com\/video\/(\w+)/,
/^dai.ly\/(\w+)/
],
html: match => {
const id = match[ 1 ];

Expand Down
4 changes: 3 additions & 1 deletion packages/ckeditor5-media-embed/tests/mediaembedediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ describe( 'MediaEmbedEditing', () => {
testMediaUpcast( [
'https://www.dailymotion.com/video/foo',
'www.dailymotion.com/video/foo',
'dailymotion.com/video/foo'
'dailymotion.com/video/foo',
'https://dai.ly/foo',
'dai.ly/foo'
],
'<div style="position: relative; padding-bottom: 100%; height: 0; ">' +
'<iframe src="https://www.dailymotion.com/embed/video/foo" ' +
Expand Down

0 comments on commit da8c3ac

Please sign in to comment.