Always use plain text event descriptions for now

pull/378/head
nicolas 2021-07-24 21:23:15 +02:00
parent 936338db3e
commit 749693b6bf
2 changed files with 4 additions and 4 deletions

View File

@ -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<unknown> => {
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)

View File

@ -25,9 +25,11 @@ export function getFormattedMeetingId(videoCallData: VideoCallData): string {
}
export function stripHtml(html: string): string {
const aMailToRegExp = /<a[\s\w="_:#;]*href="mailto:([^<>"]*)"[\s\w="_:#;]*>([^<>]*)<\/a>/g;
const aLinkRegExp = /<a[\s\w="_:#;]*href="([^<>"]*)"[\s\w="_:#;]*>([^<>]*)<\/a>/g;
return html
.replace(/<br\s?\/>/g, "\n")
.replace(aMailToRegExp, "$1")
.replace(aLinkRegExp, "$2: $1")
.replace(/<[^>]+>/g, "");
}