From 749693b6bfc372cfd5901ca5c4e25679d6182575 Mon Sep 17 00:00:00 2001 From: nicolas Date: Sat, 24 Jul 2021 21:23:15 +0200 Subject: [PATCH] Always use plain text event descriptions for now --- lib/calendarClient.ts | 6 ++---- lib/emails/helpers.ts | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/calendarClient.ts b/lib/calendarClient.ts index 711cfc1475..7eb376322c 100644 --- a/lib/calendarClient.ts +++ b/lib/calendarClient.ts @@ -513,8 +513,7 @@ const createEvent = async (credential: Credential, calEvent: CalendarEvent): Pro * We need HTML there. Google Calendar understands newlines and Apple Calendar cannot show HTML, so no HTML should * be used for Google and Apple Calendar. */ - const richEvent: CalendarEvent = - credential.type === "office365_calendar" ? parser.asRichEvent() : parser.asRichEventPlain(); + const richEvent: CalendarEvent = parser.asRichEventPlain(); const creationResult = credential ? await calendars([credential])[0].createEvent(richEvent) : null; @@ -561,8 +560,7 @@ const updateEvent = async ( ): Promise => { const parser: CalEventParser = new CalEventParser(calEvent); const newUid: string = parser.getUid(); - const richEvent: CalendarEvent = - credential.type === "office365_calendar" ? parser.asRichEvent() : parser.asRichEventPlain(); + const richEvent: CalendarEvent = parser.asRichEventPlain(); const updateResult = credential ? await calendars([credential])[0].updateEvent(uidToUpdate, richEvent) diff --git a/lib/emails/helpers.ts b/lib/emails/helpers.ts index 7c778ce41c..5c07dbbeae 100644 --- a/lib/emails/helpers.ts +++ b/lib/emails/helpers.ts @@ -25,9 +25,11 @@ export function getFormattedMeetingId(videoCallData: VideoCallData): string { } export function stripHtml(html: string): string { + const aMailToRegExp = /"]*)"[\s\w="_:#;]*>([^<>]*)<\/a>/g; const aLinkRegExp = /"]*)"[\s\w="_:#;]*>([^<>]*)<\/a>/g; return html .replace(//g, "\n") + .replace(aMailToRegExp, "$1") .replace(aLinkRegExp, "$2: $1") .replace(/<[^>]+>/g, ""); }