Download & Extend

tweaks for date_ical_escape_text to make it closer to ical spec conformance

Project:Date
Version:6.x-2.x-dev
Component:iCal API
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:ical, patch

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
date_ical.patch629 bytesIgnored: Check issue status.NoneNone

Comments

#1

Status:active» needs review

Patch included, please review

#2

Version:6.x-2.4» 6.x-2.x-dev

#3

Status:needs review» fixed

Committed. Thanks!

#4

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.

#5

Status:fixed» closed (fixed)

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

nobody click here