File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
server/services/contributions/hooks Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ module.exports = function () {
19
19
20
20
try {
21
21
// find links
22
- const youtubeRegex = new RegExp ( / (?: (?: h t t p s ? : ) ? \/ \/ ) ? (?: w w w \. ) ? y o u t u (?: b e \. c o m \/ (?: w a t c h \? (?: .* ?& (?: a m p ; ) ? ) * v = | v \/ | e m b e d \/ ) | \. b e \/ ) ( [ \w \- ] + ) (?: (?: & (?: a m p ; ) ? | \? ) [ \w \? = ] * ) * / , 'ig' ) ;
22
+ const youtubeRegex = new RegExp ( / (?: (?: h t t p s ? : ) ? \/ \/ ) ? (?: w w w \. ) ? y o u t u (?: b e \. c o m \/ (?: w a t c h \? (?: .* ?& (?: a m p ; ) ? ) * v = | v \/ | e m b e d \/ ) | \. b e \/ ) ( [ \w \- ] + ) (?: (?: & (?: a m p ; ) ? | \? ) [ \w \? = ] * ) * / , 'ig' ) ; // eslint-disable-line
23
23
const youtubeLinks = youtubeRegex . exec ( hook . data . content ) ;
24
24
25
25
// here you could scrape the url for metadata
@@ -33,7 +33,7 @@ module.exports = function () {
33
33
hook . data . teaserImg = `https://img.youtube.com/vi/${ youtubeLinks [ 1 ] } /maxresdefault.jpg` ;
34
34
hook . data . meta = Object . assign ( hook . data . meta || { } , { hasVideo : true } ) ;
35
35
}
36
- } catch ( err ) { }
36
+ } catch ( err ) { } // eslint-disable-line
37
37
38
38
return resolve ( hook ) ;
39
39
} ) ;
You can’t perform that action at this time.
0 commit comments