Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Support for a mobile youtube URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Piechaczek committed Mar 14, 2019
1 parent 2465aeb commit 41844b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mediaembedediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export default class MediaEmbedEditing extends Plugin {
name: 'youtube',
url: [
/^youtube\.com\/watch\?v=([\w-]+)/,
/^m\.youtube\.com\/watch\?v=([\w-]+)/,
/^youtube\.com\/v\/([\w-]+)/,
/^m\.youtube\.com\/v\/([\w-]+)/,
/^youtube\.com\/embed\/([\w-]+)/,
/^youtu\.be\/([\w-]+)/
],
Expand Down
4 changes: 4 additions & 0 deletions tests/mediaembedediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,14 @@ describe( 'MediaEmbedEditing', () => {
'https://www.youtube.com/watch?v=foo',
'www.youtube.com/watch?v=foo',
'youtube.com/watch?v=foo',
'https://m.youtube.com/watch?v=foo',
'm.youtube.com/watch?v=foo',

'https://www.youtube.com/v/foo',
'www.youtube.com/v/foo',
'youtube.com/v/foo',
'https://m.youtube.com/v/foo',
'm.youtube.com/v/foo',

'https://www.youtube.com/embed/foo',
'www.youtube.com/embed/foo',
Expand Down

0 comments on commit 41844b1

Please sign in to comment.