Attached is a patch that makes 2 changes to the date_ical_escape_text function to make it more ical spec conformant.
The first changes the escape of all \ characters to only those that are on a word boundary. \n as a litteral (not "\n" but a slash and an n in the text) in ical should remain as such, as it is how new lines are encoded. The previous escaping was creating a \\n which broke newlines.
The second change adjusts the wrapping and indenting of multiline blocks from using "\n " to using "\r\n ". The spec requires "\r\n" for new lines on multiline blocks, and ical generated without them fails the ical validator here (http://severinghaus.org/projects/icv/).
I'm using these two changes on http://mhvlug.org for our calendar to get better ical out of the system, and it would be great if these got upstreamed. Feedback is appreciated.
Comment | File | Size | Author |
---|---|---|---|
date_ical.patch | 629 bytes | sdague | |
Comments
Comment #1
sdague CreditAttribution: sdague commentedPatch included, please review
Comment #2
sdague CreditAttribution: sdague commentedComment #3
KarenS CreditAttribution: KarenS commentedCommitted. Thanks!
Comment #4
KarenS CreditAttribution: KarenS commentedThe patch in #475926: iCal feed needs HTML tags stripped has a different idea for line endings. I ended up committing that one. If anyone knows for sure which is better, please let me know.