From f8cec7905e43b96c889dbd0796e640de156aef79 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 19 Aug 2018 16:20:26 +0200 Subject: [PATCH] Update imgur js regexp --- wowfunding/templates/proposal/proposal.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wowfunding/templates/proposal/proposal.html b/wowfunding/templates/proposal/proposal.html index eb87203..ece3be3 100644 --- a/wowfunding/templates/proposal/proposal.html +++ b/wowfunding/templates/proposal/proposal.html @@ -182,7 +182,7 @@ $(document).ready(function(){ let regexp_xss = /^[a-zA-Z0-9.:\/]+$/; let regexp_address = /(W[o|W][a-zA-Z0-9]{95})/g; - let regexp_imgur = /(https:\/\/i.imgur.com\/[a-zA-Z]{0,7}.[jpg|png|gif|webm]+)/g; + let regexp_imgur = /(https:\/\/i.imgur.com\/[a-zA-Z0-9]{0,7}.[jpg|png|gif|webm]+)/g; let regexp_imgflip = /(https:\/\/i.imgflip.com\/[a-zA-Z0-9]{0,7}.[jpg|png|gif|webm]+)/g; let truncated_addy = function(obj){ return `${obj.substring(0, 4)}...${obj.slice(-4)}`; } @@ -201,7 +201,11 @@ function rich_img(obj) { // convert images to let html = obj.html(); - //let uid = obj.attr('data-id'); + let uid = obj.attr('data-id'); + if(uid == 30){ + debugger; + } + var matches = html.match(regexp_imgur) || []; matches = matches.concat(html.match(regexp_imgflip)); if(matches) {