From 39f16d95cb777998241fb382ac780fd29451c8c7 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 21 Jul 2021 14:25:28 +0200 Subject: [PATCH] Properly replace a link tags --- lib/emails/helpers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/emails/helpers.ts b/lib/emails/helpers.ts index e5218a0a..929a0556 100644 --- a/lib/emails/helpers.ts +++ b/lib/emails/helpers.ts @@ -25,5 +25,9 @@ export function getFormattedMeetingId(videoCallData: VideoCallData): string { } export function stripHtml(html: string): string { - return html.replace("
", "\n").replace(/<[^>]+>/g, ""); + const aLinkRegExp = /"]*)"[\s\w="_:#;]*>([^<>]*)<\/a>/g; + return html + .replace("
", "\n") + .replace(aLinkRegExp, "$2: $1") + .replace(/<[^>]+>/g, ""); }