add-to-calendar-buttons
add-to-calendar-buttons copied to clipboard
Wouldnt support multiline descriptions
To add multiline descriptions, users need to escape the newlines themselves, like so
https://stackoverflow.com/questions/666929/encoding-newlines-in-ical-files
Found this too. Works fine for Google, but breaks the Outlook ics description. Those are the only 2 I've tested.
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 || ''),
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, ' ');
}