jasonleibowitz/react-add-to-calendar-hoc

Newlines for DESCRIPTION in ics files are unescaped

wyantb opened this issue · 3 comments

Bug report

Describe the bug

Newlines in ics files need to be escaped to be visible when viewed in MS outlook and similar ics file viewers ( https://stackoverflow.com/a/18328506 ). Right now, the HOC doesn't do anything special to escape <br>s or \ns in input fields, which works great for google calendar invites, but won't show up in ics files. I'm guessing that a simple regex as part of https://github.com/jasonleibowitz/react-add-to-calendar-hoc/blob/master/lib/utils.js#L121 would do the trick in producing an ics file with newlines that ics file clients would accept and display properly.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Make an event with newlines in the description field
  2. Share in as OUTLOOK
  3. Open it up it MS outlook

Expected behavior

Newlines to appear in the description

Actual behavior

No newlines appear in the description

System information

  • OS: windows 10 pro v1809
  • Version of Library: 1.0.9

Additional context

If my instinct about where the fix is needed here is correct, happy to put up a PR with a fix. Let me know. Thanks for your work!

Hey @wyantb Feel free to put up a PR. However, I'll probably have time to take a look over the holiday, i.e. before Monday.

OK great! I've prototyped a fix locally and it now loads up fine in the macOS calendar app, just getting our QA guy to load it up in Outlook real quick before I send you a PR. Should be ready tomorrow no problem.

Apologies for the delay. This has been resolved by #37 and released in version 1.0.10, which is now available on NPM.