ical.js icon indicating copy to clipboard operation
ical.js copied to clipboard

parser error on multiline properties

Open ray007 opened this issue 2 years ago • 4 comments

In ICS data, property values can span multiple lines, with all but the first starting with whitespace. This seems to only work with standard blank (\x20) and tab (\t), but not with non-breaking space (\xa0).

ray007 avatar Mar 28 '23 09:03 ray007

Per §3.1 of RFC 5545, those are the only two characters allowed:

That is, a long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white-space character (i.e., SPACE or HTAB).

That said, that doesn't stop implementers from using other characters. Is this a situation you've encountered in the wild? If so, do you happen to know what program created the ICS file in question?

leftmostcat avatar Mar 28 '23 17:03 leftmostcat

No idea which program was used to create the ICS file, it was a public holiday calendar I used for testing. Will check if the data maybe got corrupted somewhere on the way...

ray007 avatar Mar 29 '23 09:03 ray007

While being more permissive with the whitespace char might be nice, seems your implementation is spec compliant. Guess I'll deal with it with an extra "decode" step.

ray007 avatar Mar 29 '23 12:03 ray007

I think this could be implemented without breaking other inputs. Postel's law applies here.

leftmostcat avatar Mar 29 '23 18:03 leftmostcat