lpil / icalendar

🗓️ A small library for reading and writing ICalendar files.
MIT License
103 stars 56 forks source link

Handle newlines and other odd characters, etc. #1

Closed lpil closed 8 years ago

tofran commented 3 years ago

Hello @lpil Why is this closed?

I'm using 1.1.0 and the description is not parsed as expected:

iex> events = [
     %ICalendar.Event{
          summary: "Film with Amy and Adam",
          dtstart: {{2015, 12, 24}, {8, 30, 00}},
          dtend: {{2015, 12, 24}, {8, 45, 00}},
          description: "First line\nThis is a new line\n\nDouble newline",
          location: "123 Fun Street, Toronto ON, Canada"
     }
]
iex> %ICalendar{ events: events } |> ICalendar.to_ics |> ICalendar.from_ics
[
  %ICalendar.Event{
    attendees: [],
    categories: nil,
    class: nil,
    comment: nil,
    description: "First linenThis is a new linennDouble newline",
    dtend: ~U[2015-12-24 08:45:00Z],
    dtstart: ~U[2015-12-24 08:30:00Z],
    exdates: [],
    geo: nil,
    location: "123 Fun Street, Toronto ON, Canada",
    modified: nil,
    organizer: nil,
    prodid: nil,
    rrule: nil,
    sequence: nil,
    status: nil,
    summary: "Film with Amy and Adam",
    uid: nil,
    url: nil
  }
]

Notice that First line\nThis is a new line\n\nDouble newline turns into First linenThis is a new linennDouble newline

Is this intended?

lpil commented 3 years ago

This is a 6 year old issue and likely unrelated. Please open an issue for any new problems, thanks

tofran commented 3 years ago

Opened #55

Thank you.