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 * 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. * be used for Google and Apple Calendar.
*/ */
const richEvent: CalendarEvent = const richEvent: CalendarEvent = parser.asRichEventPlain();
credential.type === "office365_calendar" ? parser.asRichEvent() : parser.asRichEventPlain();
const creationResult = credential ? await calendars([credential])[0].createEvent(richEvent) : null; const creationResult = credential ? await calendars([credential])[0].createEvent(richEvent) : null;
@ -561,8 +560,7 @@ const updateEvent = async (
): Promise<unknown> => { ): Promise<unknown> => {
const parser: CalEventParser = new CalEventParser(calEvent); const parser: CalEventParser = new CalEventParser(calEvent);
const newUid: string = parser.getUid(); const newUid: string = parser.getUid();
const richEvent: CalendarEvent = const richEvent: CalendarEvent = parser.asRichEventPlain();
credential.type === "office365_calendar" ? parser.asRichEvent() : parser.asRichEventPlain();
const updateResult = credential const updateResult = credential
? await calendars([credential])[0].updateEvent(uidToUpdate, richEvent) ? 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 { 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; const aLinkRegExp = /<a[\s\w="_:#;]*href="([^<>"]*)"[\s\w="_:#;]*>([^<>]*)<\/a>/g;
return html return html
.replace(/<br\s?\/>/g, "\n") .replace(/<br\s?\/>/g, "\n")
.replace(aMailToRegExp, "$1")
.replace(aLinkRegExp, "$2: $1") .replace(aLinkRegExp, "$2: $1")
.replace(/<[^>]+>/g, ""); .replace(/<[^>]+>/g, "");
} }