Skip to content

ics does not support 5545 3.1 (long line folding) #215

@acanewby

Description

@acanewby

First off, loving the library! Thanks for all the hard work.

I've implemented an ics file generator and noticed that some of my LOCATION: values are flagged by the icalendar.org validator.

Turns out that RFC 5545 3.1. Content Lines is not being respected by ics.py.

ics.py: 0.6
python 3.74
macOs Catalina (10.15.2)

Basically, for values exceeding 75 characters, you need to "fold" by inserting a CR [SPACE] sequence after each 75 characters.

Looking at the ics.py code, it would seem that perhaps a good place to do this would be:

  • fold at the end of ics.utils.escape_string(), just before the string is returned
  • unfold at the beginning of ics.utils.unescape_string(), just before the string is unescaped

I'm very new to this library, so not (yet) ready to dive into the code. However, if you agree that the above is the right approach, I'd be happy to try and knock out a fix and submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions