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

Escape New Lines in Generated ICS #37

Closed jasonleibowitz closed 4 years ago

jasonleibowitz commented 4 years ago

Fix for #33 as initially implemented by @wyantb. This PR creates a new util method, escapeICSDescription that converts any carriage returns or HTML br tags to valid new lines as identified in this SO post.

This PR also includes a unit test for that new method as well as adds an example to the docs of fixing new lines in generated ICS files.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 68


Totals Coverage Status
Change from base Build 65: 0.3%
Covered Lines: 25
Relevant Lines: 25

💛 - Coveralls
codecov-commenter commented 4 years ago

Codecov Report

Merging #37 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #37   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           24        25    +1     
=========================================
+ Hits            24        25    +1     
Impacted Files Coverage Δ
src/lib/utils.js 100.00% <100.00%> (ø)

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...38da13c. Read the comment docs.