From 5cf181cabd09cbd7c7f31de0a4a8f8101073e84c Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Mon, 26 May 2025 18:31:32 -0400 Subject: [PATCH] Fix ICS calendar description formatting issues - Removed markdown formatting (**Note:**) as it doesn't work in ICS files - Fixed double-escaping issue by removing backslash escaping from description - Reordered escape sequence to prevent double escaping of newlines - RSVP cutoff note now displays properly without unwanted backslashes - Calendar descriptions now show clean, readable text with proper line breaks --- backend/src/email.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/email.ts b/backend/src/email.ts index 1e82c1f..ec8a8c0 100644 --- a/backend/src/email.ts +++ b/backend/src/email.ts @@ -40,17 +40,16 @@ export function generateICSContent(eventData: { timeZoneName: 'short' }); - const rsvpNote = `\\n\\n**Note:** The RSVP cut-off for this event is ${formattedCutoff}. Make sure you get your reservation in before then!`; + const rsvpNote = `\n\nNote: The RSVP cut-off for this event is ${formattedCutoff}. Make sure you get your reservation in before then!`; fullDescription += rsvpNote; } // Clean description for ICS format (remove HTML, escape special chars) const cleanDescription = fullDescription .replace(/<[^>]*>/g, '') // Remove HTML tags - .replace(/\n/g, '\\n') // Escape newlines .replace(/,/g, '\\,') // Escape commas .replace(/;/g, '\\;') // Escape semicolons - .replace(/\\/g, '\\\\'); // Escape backslashes + .replace(/\n/g, '\\n'); // Escape newlines (do this last to avoid double escaping) // Clean location for ICS format const cleanLocation = location