From dca6352e30b042584cee7941966531400fa6f9d4 Mon Sep 17 00:00:00 2001 From: Sebastian Pekarek Date: Sun, 15 Sep 2024 17:40:05 +0200 Subject: [PATCH] fix(Event): Add missing : for ORGANIZERs close #610 --- src/event.ts | 5 ++++- test/event.ts | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/event.ts b/src/event.ts index 543fba9d..b058b365 100755 --- a/src/event.ts +++ b/src/event.ts @@ -1816,9 +1816,12 @@ export default class ICalEvent { if (this.data.organizer.email && this.data.organizer.mailto) { g += ';EMAIL=' + escape(this.data.organizer.email, false); } + + g += ':'; if(this.data.organizer.email) { - g += ':mailto:' + escape(this.data.organizer.mailto || this.data.organizer.email, false); + g += 'mailto:' + escape(this.data.organizer.mailto || this.data.organizer.email, false); } + g += '\r\n'; } diff --git a/test/event.ts b/test/event.ts index 82108887..9cae0528 100644 --- a/test/event.ts +++ b/test/event.ts @@ -1432,6 +1432,16 @@ describe('ical-generator Event', function () { sentBy: undefined }); }); + + it('should include a : (PR #610)', function () { + const event = new ICalEvent({ + start: moment(), + summary: 'Example Event', + organizer: { name: 'Some Guy' } + }, new ICalCalendar()); + + assert.ok(event.toString().includes('ORGANIZER;CN="Some Guy":')); + }); }); describe('createAttendee()', function () {