add-to-calendar-buttons icon indicating copy to clipboard operation
add-to-calendar-buttons copied to clipboard

Wouldnt support multiline descriptions

Open commonpike opened this issue 6 years ago • 3 comments

To add multiline descriptions, users need to escape the newlines themselves, like so

https://stackoverflow.com/questions/666929/encoding-newlines-in-ical-files

commonpike avatar Jun 03 '19 09:06 commonpike

Found this too. Works fine for Google, but breaks the Outlook ics description. Those are the only 2 I've tested.

CJFulford avatar Jul 02 '19 18:07 CJFulford

I can get multiline description to work in the .ics file in most browsers except for IE. I just pass the event description to escapeJSValue before the link is generated. But in Internet Explorer it only displays the first line because the encoded newlines become decoded. We may want to look at changing how ieDownloadCalendar() downloads the .ics file on IE.

'DESCRIPTION:' + escapeJSValue(event.description || ''),

jruns avatar Nov 10 '20 16:11 jruns

For now I'm doing a check before the .ics link is generated that checks if ieMustDownload is true and then replaces all newlines in the description with a space. At least all of the description text will be there, even though it won't be pretty. And that will only be fore IE, and not the new Edge browser. And most of my visitors use Chrome, Firefox, or Safari anyway.

if (ieMustDownload) { event.description = event.description || ''; event.description = event.description.replace(/(\r?\n|\r)/gm, ' '); }

jruns avatar Nov 10 '20 16:11 jruns