Comparing version 2.10.1 to 2.11.0
@@ -145,5 +145,5 @@ 'use strict'; | ||
}; | ||
}], [/https:\/\/embed\.acast\.com\/([\w.-]+)\/([\w.-]+)/, function (match) { | ||
var channel = match[1]; | ||
var name = match[2]; | ||
}], [/https:\/\/(embed|www)\.acast\.com\/([\w.-]+)\/([\w.-]+)/, function (match) { | ||
var channel = match[2]; | ||
var name = match[3]; | ||
return { | ||
@@ -153,3 +153,5 @@ type: 'acast', | ||
name: name, | ||
url: 'https://embed.acast.com/' + channel + '/' + name | ||
url: 'https://embed.acast.com/' + channel + '/' + name, | ||
width: 540, | ||
height: 540 | ||
}; | ||
@@ -163,2 +165,8 @@ }], [/https:\/\/www\.scribd\.com\/embeds\/([0-9]+)\/content/, function (match) { | ||
}; | ||
}], [/https:\/\/open.spotify.com\/(.+)/, function (match) { | ||
var uri = match[1].replace(/\//g, ':'); | ||
return { | ||
type: 'spotify', | ||
url: 'https://embed.spotify.com/?uri=spotify:' + uri | ||
}; | ||
}]]; |
@@ -130,5 +130,5 @@ const allowed = [ | ||
}], | ||
[/https:\/\/embed\.acast\.com\/([\w.-]+)\/([\w.-]+)/, match => { | ||
const channel = match[1]; | ||
const name = match[2]; | ||
[/https:\/\/(embed|www)\.acast\.com\/([\w.-]+)\/([\w.-]+)/, match => { | ||
const channel = match[2]; | ||
const name = match[3]; | ||
return { | ||
@@ -138,3 +138,5 @@ type: 'acast', | ||
name, | ||
url: `https://embed.acast.com/${channel}/${name}` | ||
url: `https://embed.acast.com/${channel}/${name}`, | ||
width: 540, | ||
height: 540 | ||
}; | ||
@@ -149,2 +151,9 @@ }], | ||
}; | ||
}], | ||
[/https:\/\/open.spotify.com\/(.+)/, match => { | ||
const uri = match[1].replace(/\//g, ':'); | ||
return { | ||
type: 'spotify', | ||
url: `https://embed.spotify.com/?uri=spotify:${uri}` | ||
}; | ||
}] | ||
@@ -151,0 +160,0 @@ ]; |
{ | ||
"name": "embeds", | ||
"version": "2.10.1", | ||
"version": "2.11.0", | ||
"description": "Parse & render embeds", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -535,3 +535,5 @@ import test from './tape-wrapper'; | ||
url: 'https://embed.acast.com/specialrelationship/-1-terrorismandnationalsecurity', | ||
name: '-1-terrorismandnationalsecurity' | ||
name: '-1-terrorismandnationalsecurity', | ||
width: 540, | ||
height: 540 | ||
}; | ||
@@ -541,2 +543,3 @@ | ||
t.deepEqual(parseInput('https://embed.acast.com/specialrelationship/-1-terrorismandnationalsecurity'), expected); | ||
t.deepEqual(parseInput('https://www.acast.com/specialrelationship/-1-terrorismandnationalsecurity'), expected); | ||
}); | ||
@@ -561,1 +564,27 @@ | ||
}); | ||
test('spotify', t => { | ||
t.deepEqual( | ||
parseInput('https://open.spotify.com/artist/6kBDZFXuLrZgHnvmPu9NsG'), | ||
{ | ||
type: 'spotify', | ||
url: 'https://embed.spotify.com/?uri=spotify:artist:6kBDZFXuLrZgHnvmPu9NsG' | ||
} | ||
); | ||
t.deepEqual( | ||
parseInput('https://open.spotify.com/track/6sEz1Cd0HVXRXuvIw9zAmK'), | ||
{ | ||
type: 'spotify', | ||
url: 'https://embed.spotify.com/?uri=spotify:track:6sEz1Cd0HVXRXuvIw9zAmK' | ||
} | ||
); | ||
t.deepEqual( | ||
parseInput('https://open.spotify.com/user/hamiltonmusical/playlist/4Rf5kHoohcqAS5Qc6gglaX'), | ||
{ | ||
type: 'spotify', | ||
url: 'https://embed.spotify.com/?uri=spotify:user:hamiltonmusical:playlist:4Rf5kHoohcqAS5Qc6gglaX' | ||
} | ||
); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134795
3304