@@ -3,14 +3,17 @@ import type { ServicesConfigType } from './serviceConfig';
33
44const SERVICES : ServicesConfigType = {
55 vimeo : {
6- regex : / (?: h t t p [ s ] ? : \/ \/ ) ? (?: w w w .) ? (?: p l a y e r .) ? v i m e o \. c o (?: .+ \/ ( [ ^ \/ ] \d + ) (?: # t = [ \d ] + ) ? s ? $ ) / ,
7- embedUrl : 'https://player.vimeo.com/video/<%= remote_id %>?title=0&byline=0' ,
6+ regex :
7+ / (?: h t t p [ s ] ? : \/ \/ ) ? (?: w w w .) ? (?: p l a y e r .) ? v i m e o \. c o (?: .+ \/ ( [ ^ \/ ] \d + ) (?: # t = [ \d ] + ) ? s ? $ ) / ,
8+ embedUrl :
9+ 'https://player.vimeo.com/video/<%= remote_id %>?title=0&byline=0' ,
810 html : '<iframe style="width:100%;" height="320" frameborder="0"></iframe>' ,
911 height : 320 ,
1012 width : 580 ,
1113 } ,
1214 youtube : {
13- regex : / (?: h t t p s ? : \/ \/ ) ? (?: w w w \. ) ? (?: (?: y o u t u \. b e \/ ) | (?: y o u t u b e \. c o m ) \/ (?: v \/ | u \/ \w \/ | e m b e d \/ | w a t c h ) ) (?: (?: \? v = ) ? ( [ ^ # & ? = ] * ) ) ? ( (?: [ ? & ] \w * = \w * ) * ) / ,
15+ regex :
16+ / (?: h t t p s ? : \/ \/ ) ? (?: w w w \. ) ? (?: (?: y o u t u \. b e \/ ) | (?: y o u t u b e \. c o m ) \/ (?: v \/ | u \/ \w \/ | e m b e d \/ | w a t c h | s h o r t s \/ ) ) (?: (?: \? v = ) ? ( [ ^ # & ? = ] * ) ) ? ( (?: [ ? & ] \w * = \w * ) * ) / ,
1417 embedUrl : 'https://www.youtube.com/embed/<%= remote_id %>' ,
1518 html : '<iframe style="width:100%;" height="320" frameborder="0" allowfullscreen></iframe>' ,
1619 height : 320 ,
@@ -29,9 +32,10 @@ const SERVICES: ServicesConfigType = {
2932 list : 'list' ,
3033 } ;
3134
32- let newParams = params . slice ( 1 )
35+ let newParams = params
36+ . slice ( 1 )
3337 . split ( '&' )
34- . map ( param => {
38+ . map ( ( param ) => {
3539 const [ name , value ] = param . split ( '=' ) ;
3640
3741 if ( ! id && name === 'v' ) {
@@ -40,19 +44,21 @@ const SERVICES: ServicesConfigType = {
4044 return null ;
4145 }
4246
43- if ( ! ( paramsMap [ name ] ) ) {
47+ if ( ! paramsMap [ name ] ) {
4448 return null ;
4549 }
4650
47- if ( value === 'LL' ||
51+ if (
52+ value === 'LL' ||
4853 value . startsWith ( 'RDMM' ) ||
49- value . startsWith ( 'FL' ) ) {
54+ value . startsWith ( 'FL' )
55+ ) {
5056 return null ;
5157 }
5258
5359 return `${ paramsMap [ name ] } =${ value } ` ;
5460 } )
55- . filter ( param => ! ! param ) ;
61+ . filter ( ( param ) => ! ! param ) ;
5662
5763 return id + '?' + newParams . join ( '&' ) ;
5864 } ,
@@ -101,30 +107,33 @@ const SERVICES: ServicesConfigType = {
101107 } ,
102108 'yandex-music-album' : {
103109 regex : / h t t p s ? : \/ \/ m u s i c \. y a n d e x \. r u \/ a l b u m \/ ( [ 0 - 9 ] * ) \/ ? $ / ,
104- embedUrl : 'https://music\ .yandex\ .ru/iframe/#album/<%= remote_id %>/' ,
105- html : '<iframe frameborder=\"0\ " style=\ "border:none;width:540px;height:400px;\ " style=\ "width:100%;\ " height=\ "400\ "></iframe>' ,
110+ embedUrl : 'https://music.yandex.ru/iframe/#album/<%= remote_id %>/' ,
111+ html : '<iframe frameborder="0 " style="border:none;width:540px;height:400px;" style="width:100%;" height="400"></iframe>' ,
106112 height : 400 ,
107113 width : 540 ,
108114 } ,
109115 'yandex-music-track' : {
110116 regex : / h t t p s ? : \/ \/ m u s i c \. y a n d e x \. r u \/ a l b u m \/ ( [ 0 - 9 ] * ) \/ t r a c k \/ ( [ 0 - 9 ] * ) / ,
111- embedUrl : 'https://music\ .yandex\ .ru/iframe/#track/<%= remote_id %>/' ,
117+ embedUrl : 'https://music.yandex.ru/iframe/#track/<%= remote_id %>/' ,
112118 html : '<iframe frameborder="0" style="border:none;width:540px;height:100px;" style="width:100%;" height="100"></iframe>' ,
113119 height : 100 ,
114120 width : 540 ,
115121 id : ( ids ) => ids . join ( '/' ) ,
116122 } ,
117123 'yandex-music-playlist' : {
118- regex : / h t t p s ? : \/ \/ m u s i c \. y a n d e x \. r u \/ u s e r s \/ ( [ ^ \/ \? \& ] * ) \/ p l a y l i s t s \/ ( [ 0 - 9 ] * ) / ,
119- embedUrl : 'https://music\.yandex\.ru/iframe/#playlist/<%= remote_id %>/show/cover/description/' ,
124+ regex :
125+ / h t t p s ? : \/ \/ m u s i c \. y a n d e x \. r u \/ u s e r s \/ ( [ ^ \/ \? \& ] * ) \/ p l a y l i s t s \/ ( [ 0 - 9 ] * ) / ,
126+ embedUrl :
127+ 'https://music.yandex.ru/iframe/#playlist/<%= remote_id %>/show/cover/description/' ,
120128 html : '<iframe frameborder="0" style="border:none;width:540px;height:400px;" width="540" height="400"></iframe>' ,
121129 height : 400 ,
122130 width : 540 ,
123131 id : ( ids ) => ids . join ( '/' ) ,
124132 } ,
125133 codepen : {
126134 regex : / h t t p s ? : \/ \/ c o d e p e n \. i o \/ ( [ ^ \/ \? \& ] * ) \/ p e n \/ ( [ ^ \/ \? \& ] * ) / ,
127- embedUrl : 'https://codepen.io/<%= remote_id %>?height=300&theme-id=0&default-tab=css,result&embed-version=2' ,
135+ embedUrl :
136+ 'https://codepen.io/<%= remote_id %>?height=300&theme-id=0&default-tab=css,result&embed-version=2' ,
128137 html : "<iframe height='300' scrolling='no' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'></iframe>" ,
129138 height : 300 ,
130139 width : 600 ,
@@ -137,15 +146,16 @@ const SERVICES: ServicesConfigType = {
137146 html : '<iframe width="400" height="505" style="margin: 0 auto;" frameborder="0" scrolling="no" allowtransparency="true"></iframe>' ,
138147 height : 505 ,
139148 width : 400 ,
140- id : ( groups : string [ ] ) => groups ?. [ 0 ] ?. split ( "/" ) [ 0 ] ,
149+ id : ( groups : string [ ] ) => groups ?. [ 0 ] ?. split ( '/' ) [ 0 ] ,
141150 } ,
142151 twitter : {
143152 regex : / ^ h t t p s ? : \/ \/ ( w w w \. ) ? (?: t w i t t e r \. c o m | x \. c o m ) \/ .+ \/ s t a t u s \/ ( \d + ) / ,
144- embedUrl : 'https://platform.twitter.com/embed/Tweet.html?id=<%= remote_id %>' ,
153+ embedUrl :
154+ 'https://platform.twitter.com/embed/Tweet.html?id=<%= remote_id %>' ,
145155 html : '<iframe width="600" height="600" style="margin: 0 auto;" frameborder="0" scrolling="no" allowtransparency="true"></iframe>' ,
146156 height : 300 ,
147157 width : 600 ,
148- id : ids => ids [ 1 ] ,
158+ id : ( ids ) => ids [ 1 ] ,
149159 } ,
150160 reddit : {
151161 regex : / h t t p s : \/ \/ w w w \. r e d d i t \. c o m \/ ( .* ) / ,
@@ -166,15 +176,17 @@ const SERVICES: ServicesConfigType = {
166176 } ,
167177 facebook : {
168178 regex : / h t t p s ? : \/ \/ w w w .f a c e b o o k .c o m \/ ( [ ^ \/ \? \& ] * ) \/ ( .* ) / ,
169- embedUrl : 'https://www.facebook.com/plugins/post.php?href=https://www.facebook.com/<%= remote_id %>&width=500' ,
179+ embedUrl :
180+ 'https://www.facebook.com/plugins/post.php?href=https://www.facebook.com/<%= remote_id %>&width=500' ,
170181 html : "<iframe scrolling='no' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%; min-height: 500px; max-height: 1000px;'></iframe>" ,
171182 id : ( ids ) => {
172183 return ids . join ( '/' ) ;
173184 } ,
174185 } ,
175186 aparat : {
176187 regex : / (?: h t t p [ s ] ? : \/ \/ ) ? (?: w w w .) ? a p a r a t \. c o m \/ v \/ ( [ ^ \/ \? \& ] + ) \/ ? / ,
177- embedUrl : 'https://www.aparat.com/video/video/embed/videohash/<%= remote_id %>/vt/frame' ,
188+ embedUrl :
189+ 'https://www.aparat.com/video/video/embed/videohash/<%= remote_id %>/vt/frame' ,
178190 html : '<iframe width="600" height="300" style="margin: 0 auto;" frameborder="0" scrolling="no" allowtransparency="true"></iframe>' ,
179191 height : 300 ,
180192 width : 600 ,
@@ -186,7 +198,8 @@ const SERVICES: ServicesConfigType = {
186198 } ,
187199 github : {
188200 regex : / h t t p s ? : \/ \/ g i s t .g i t h u b .c o m \/ ( [ ^ \/ \? \& ] * ) \/ ( [ ^ \/ \? \& ] * ) / ,
189- embedUrl : 'data:text/html;charset=utf-8,<head><base target="_blank" /></head><body><script src="https://gist.github.com/<%= remote_id %>" ></script></body>' ,
201+ embedUrl :
202+ 'data:text/html;charset=utf-8,<head><base target="_blank" /></head><body><script src="https://gist.github.com/<%= remote_id %>" ></script></body>' ,
190203 html : '<iframe width="100%" height="350" frameborder="0" style="margin: 0 auto;"></iframe>' ,
191204 height : 300 ,
192205 width : 600 ,
0 commit comments