Accomodated alternate clip URL scheme

https://twitch.tv/<channel>/clips/<slug> clip links now work
This commit is contained in:
WastedMeerkat 2021-10-21 00:43:38 -05:00 committed by GitHub
parent 38087bd3f7
commit ca019d1997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -424,7 +424,7 @@ Embedding =
key: 'TwitchTV'
regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/
el: (a) ->
m = a.dataset.href.match /^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(clip\/)?(\w[^#\&\?]*)/;
m = a.dataset.href.match /^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/;
if m[1] or m[2]
url = "//clips.twitch.tv/embed?clip=#{m[3]}&parent=#{location.hostname}"
else