Explorar el Código

"id" of the video can be extracted a simpler way.

Kamil Piechaczek hace 7 años
padre
commit
746b9a8a74
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      packages/ckeditor5-media-embed/src/mediaembedediting.js

+ 4 - 4
packages/ckeditor5-media-embed/src/mediaembedediting.js

@@ -36,7 +36,7 @@ export default class MediaEmbedEditing extends Plugin {
 					name: 'dailymotion',
 					url: /^dailymotion\.com\/video\/(\w+)/,
 					html: match => {
-						const id = match.slice( -1 );
+						const id = match[ 1 ];
 
 						return (
 							'<div style="position: relative; padding-bottom: 100%; height: 0; ">' +
@@ -57,7 +57,7 @@ export default class MediaEmbedEditing extends Plugin {
 						/^open\.spotify\.com\/(track\/\w+)/
 					],
 					html: match => {
-						const id = match.slice( -1 );
+						const id = match[ 1 ];
 
 						return (
 							'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;">' +
@@ -79,7 +79,7 @@ export default class MediaEmbedEditing extends Plugin {
 						/^youtu\.be\/([a-zA-Z0-9_-]+)/
 					],
 					html: match => {
-						const id = match.slice( -1 );
+						const id = match[ 1 ];
 
 						return (
 							'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;">' +
@@ -104,7 +104,7 @@ export default class MediaEmbedEditing extends Plugin {
 						/^player\.vimeo\.com\/video\/(\d+)/
 					],
 					html: match => {
-						const id = match.slice( -1 );
+						const id = match[ 1 ];
 
 						return (
 							'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;">' +