jasonleibowitz / react-add-to-calendar-hoc

Simple Unopinionated React Add to Calendar Button. Bring your own components.
http://leibowitz.me/react-add-to-calendar-hoc/docs/
MIT License
70 stars 40 forks source link

fix: escape ics multiline descriptions #34

Closed wyantb closed 4 years ago

wyantb commented 4 years ago

Simple proposed fix for https://github.com/jasonleibowitz/react-add-to-calendar-hoc/issues/33 - with a little bit of regexing, we can take newlines (optionally windows style with CRLF) and html <br> tags (optionally with a closing /) and replace them with literal \n characters that the calendar apps expect for newlines.

Tested an example ics file in both Windows Outlook and macOS Calendar

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 66


Totals Coverage Status
Change from base Build 65: 0.0%
Covered Lines: 24
Relevant Lines: 24

💛 - Coveralls
codecov-io commented 4 years ago

Codecov Report

Merging #34 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #34   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          24     24           
=====================================
  Hits           24     24

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6206080...e0d11a0. Read the comment docs.

wyantb commented 4 years ago

@jasonleibowitz any thoughts on this one? I can take a look at testing it if the codecov report comments are concerning to you.

wyantb commented 4 years ago

One more poke here - should I just start using my fork of this project if I need to get the fix in?

SalahAdDin commented 4 years ago

It seems he is not active right now, maybe the fork.

jasonleibowitz commented 4 years ago

Hey, sorry for the delay on this. I wanted to get this done for you ASAP so I created a new PR. You edited the compiled lib file rather than the src file. I'm going to close this PR in favor of the other one that solves #33. I also included an example in the docs for this.

Thanks for your work on this though.

wyantb commented 4 years ago

...I don't know how I didn't notice I was editing the generated lib stuff, it was pretty ugly haha. So it goes. Thanks @jasonleibowitz !