support wrapped lines in ical files (as per RFC 5545 section 3.1)

This commit is contained in:
Fabrizio Iannetti 2024-09-16 13:27:52 +02:00
parent 08a699ca9d
commit 4e9f195851

View File

@ -41,6 +41,9 @@ pub fn load_calendar(calendar_path: &std::path::Path, events: &mut EventsCollect
Err(e) => { warn!("Could not read the calendar: {}", e); return; }, Err(e) => { warn!("Could not read the calendar: {}", e); return; },
}; };
// make sure to handle wrapped lines (as per RFC 5545 section 3.1)
let contents = icalendar::parser::unfold(&contents);
let res = icalendar::parser::read_calendar(&contents); let res = icalendar::parser::read_calendar(&contents);
match res { match res {
Ok(parsed_calendar) => { calendar.extend(parsed_calendar.components); }, Ok(parsed_calendar) => { calendar.extend(parsed_calendar.components); },