parent
9eeff2cc5c
commit
928a626c2e
|
@ -455,6 +455,7 @@ describe('parseEmbedPlayerFromUrl', () => {
|
||||||
'https://tenor.com/notView/gifId',
|
'https://tenor.com/notView/gifId',
|
||||||
'https://tenor.com/view',
|
'https://tenor.com/view',
|
||||||
'https://tenor.com/view/gifId.gif',
|
'https://tenor.com/view/gifId.gif',
|
||||||
|
'https://tenor.com/intl/view/gifId.gif',
|
||||||
]
|
]
|
||||||
|
|
||||||
const outputs = [
|
const outputs = [
|
||||||
|
@ -742,6 +743,13 @@ describe('parseEmbedPlayerFromUrl', () => {
|
||||||
hideDetails: true,
|
hideDetails: true,
|
||||||
playerUri: 'https://tenor.com/view/gifId.gif',
|
playerUri: 'https://tenor.com/view/gifId.gif',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'tenor_gif',
|
||||||
|
source: 'tenor',
|
||||||
|
isGif: true,
|
||||||
|
hideDetails: true,
|
||||||
|
playerUri: 'https://tenor.com/intl/view/gifId.gif',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
it('correctly grabs the correct id from uri', () => {
|
it('correctly grabs the correct id from uri', () => {
|
||||||
|
|
|
@ -319,9 +319,12 @@ export function parseEmbedPlayerFromUrl(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urlp.hostname === 'tenor.com' || urlp.hostname === 'www.tenor.com') {
|
if (urlp.hostname === 'tenor.com' || urlp.hostname === 'www.tenor.com') {
|
||||||
const [_, path, filename] = urlp.pathname.split('/')
|
const [_, pathOrIntl, pathOrFilename, intlFilename] =
|
||||||
|
urlp.pathname.split('/')
|
||||||
|
const isIntl = pathOrFilename === 'view'
|
||||||
|
const filename = isIntl ? intlFilename : pathOrFilename
|
||||||
|
|
||||||
if (path === 'view' && filename) {
|
if ((pathOrIntl === 'view' || pathOrFilename === 'view') && filename) {
|
||||||
const includesExt = filename.split('.').pop() === 'gif'
|
const includesExt = filename.split('.').pop() === 'gif'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue