From 6f93a1fb6a9a99ff725e71e220f1b68b72f32f0d Mon Sep 17 00:00:00 2001 From: HushBugger Date: Tue, 7 Aug 2018 18:24:06 +0200 Subject: [PATCH] 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. --- src/Linkification/Embedding.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 245f33544..d50e39ff7 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -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('') %> , key: 'VidLii' regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/