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.

CommentFileSizeAuthor
date_ical.patch629 bytessdague
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sdague’s picture

Status: Active » Needs review

Patch included, please review

sdague’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
KarenS’s picture

Status: Needs review » Fixed

Committed. Thanks!

KarenS’s picture

The 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.

Status: Fixed » Closed (fixed)
Issue tags: -patch, -ical

Automatically closed -- issue fixed for 2 weeks with no activity.