From 736d3f2ced01bc5b0c4bb5c920cf6b5a8ad5b32e Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 21 Jun 2020 11:26:36 +0200 Subject: [PATCH] Improve Tik Tok Embed Apply tiktok embed for shortened links Make embed wider so desktop styling is applied --- js/plugins.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index 8218f78..9d76376 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -558,8 +558,8 @@ plugins.factory('userPlugins', function() { * Very similar to twitter */ var tikTokPlugin = new UrlPlugin('TikTok', function(url) { - var regex = /^https?:\/\/(www\.)?tiktok\.com\/@(.+)\/video\/(.+)/i, - match = url.match(regex); + var regex = /^https?:\/\/(?:www\.)?tiktok\.com\/@(?:.+)\/video\/(?:.+)\/?$|^https?:\/\/vm\.tiktok\.com\/[a-zA-Z1-9]{7}\/?$/i; + var match = url.match(regex); if (match) { @@ -571,12 +571,12 @@ plugins.factory('userPlugins', function() { return response.json(); }) .then(function(data) { - // separate the HTML into content and script tag + // Separate the HTML into content and script tag var scriptIndex = data.html.indexOf("