From 53a8378bd33a61752d3a7d9c91d2acf93ad77c4e Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Fri, 6 Mar 2020 19:31:58 -0800 Subject: [PATCH] Remove quoted tweet urls from tweet body --- build/lib/tweetparse.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/lib/tweetparse.js b/build/lib/tweetparse.js index c8b6740..5cde97e 100644 --- a/build/lib/tweetparse.js +++ b/build/lib/tweetparse.js @@ -45,8 +45,9 @@ var entityProcessors = { urls (urls, tweet) { urls.forEach(({ url, expanded_url, display_url }) => { - const className = (tweet.quoted_status_permalink && url === tweet.quoted_status_permalink.url) ? 'quoted-tweet' : 'url'; - tweet.html = tweet.html.replace(url, `${display_url}`); + const isQT = tweet.quoted_status_permalink && url === tweet.quoted_status_permalink.url; + const className = isQT ? 'quoted-tweet' : 'url'; + tweet.html = tweet.html.replace(url, isQT ? '' : `${display_url}`); }); },