From 9b4b70e2e4e8ad5d60f383d4953f1ade802c7bb3 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 9 Mar 2020 00:33:52 +0100 Subject: [PATCH] Fix card links --- src/formatters.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/formatters.nim b/src/formatters.nim index 4999f10..ec7c709 100644 --- a/src/formatters.nim +++ b/src/formatters.nim @@ -9,7 +9,7 @@ from unicode import Rune, `$` const ytRegex = re"([A-z.]+\.)?youtu(be\.com|\.be)" twRegex = re"(www\.|mobile\.)?twitter\.com" - cards = "https://cards.twitter.com/cards" + cards = "cards.twitter.com/cards" tco = "https://t.co" nbsp = $Rune(0x000A0) @@ -40,9 +40,9 @@ proc replaceUrl*(url: string; prefs: Prefs; absolute=""): string = if prefs.replaceYouTube.len > 0: result = result.replace(ytRegex, prefs.replaceYouTube) if prefs.replaceTwitter.len > 0: - result = result.replace(twRegex, prefs.replaceTwitter) result = result.replace(tco, "https://" & prefs.replaceTwitter & "/t.co") - result = result.replace(cards, "https://" & prefs.replaceTwitter & "/cards") + result = result.replace(cards, prefs.replaceTwitter & "/cards") + result = result.replace(twRegex, prefs.replaceTwitter) if absolute.len > 0: result = result.replace("href=\"/", "href=\"https://" & absolute & "/")