Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wouldnt support multiline descriptions #4

Open
commonpike opened this issue Jun 3, 2019 · 3 comments
Open

Wouldnt support multiline descriptions #4

commonpike opened this issue Jun 3, 2019 · 3 comments

Comments

@commonpike
Copy link
Owner

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

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

@CJFulford
Copy link

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

@jruns
Copy link

jruns commented Nov 10, 2020

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
Copy link

jruns commented Nov 10, 2020

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, ' ');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants