Enable more general Twitter image embedding

You can get Twitter images in different sizes by appending a
size (":thumb", ":large", ":orig", etc.) to the URL. Those weren't
embeddable yet, because they no longer look like ordinary image URLs.

This makes them embeddable.
This commit is contained in:
HushBugger 2018-08-07 18:24:06 +02:00
parent ed01e4ca5f
commit 6f93a1fb6a

View File

@ -419,6 +419,12 @@ Embedding =
cont
else
el
,
key: 'TwitterImage'
regExp: /^\w+:\/\/pbs\.twimg\.com\/media\/([\w-]{15}\.(?:gif|png|jpg):\w+)/i
style: ''
el: (a) ->
$.el 'div', <%= html('<a target="_blank" href="https://pbs.twimg.com/media/${a.dataset.uid}"><img src="https://pbs.twimg.com/media/${a.dataset.uid}" style="max-width: 80vw; max-height: 80vh;"></a>') %>
,
key: 'VidLii'
regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/