Always use plain text event descriptions for now
parent
936338db3e
commit
749693b6bf
|
@ -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)
|
||||||
|
|
|
@ -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, "");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue