mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-23 17:26:11 +01:00
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:
parent
0401763a10
commit
d1b74bc2bf
2 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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") %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue