Notes with returns in them broke the iCal feed. By looking at how iCal itself encodes notes with returns/linebreaks in them, I figured out that you need a one line string with each line break as a literal '\n', which iCal then interprets as a linebreak.

iCal now accepts feeds containing notes with linebreaks, and properly interprets those linebreaks.

Fixes #319



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@289 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2006-07-23 06:36:18 +00:00
parent 0401763a10
commit d1b74bc2bf
2 changed files with 6 additions and 1 deletions

View file

@ -57,4 +57,9 @@ module FeedHelper
return result_string
end
def format_ical_notes(notes)
split_notes = notes.split(/\n/)
joined_notes = split_notes.join("\\n")
end
end

View file

@ -14,7 +14,7 @@ DTSTAMP:<%= @todo.created_at.strftime("%Y%m%dT%H%M%SZ") %>
DTSTART;VALUE=DATE:<%= @todo.created_at.strftime("%Y%m%d") %>
SUMMARY:<%= @todo.description %>
<% if @todo.notes? -%>
DESCRIPTION:<%= @todo.notes %>
DESCRIPTION:<%= format_ical_notes(@todo.notes) %>
<% end -%>
<% if @todo.due -%>
DUE;VALUE=DATE:<%= @todo.due.strftime("%Y%m%d") %>