Search code examples
icloudicalendarcaldav

CALDAV add event in icloud with notes


I have implemented caldav api's to manage icloud calendar and everything working as expected.

But now I am trying sent event with description includes html content instead of plain text. I had done my research and couldn't be success.

Below is sample API and screenshot of event in icloud calendar.

PUT /home/meeting.ics HTTP/1.1
Host: ...
Content-Length: ...
Content-Type: text/calendar; charset=utf-8

BEGIN:VCALENDAR
BEGIN:VEVENT
UID:test123
SUMMARY:Test Event
DESCRIPTION:Hi User <br/><br/> Text...<br/>Note :  </br><br/>Thank you
DTSTART:20180920T080000Z
DTEND:20180920T170000Z
END:VEVENT
END:VCALENDAR

enter image description here

In the above screenshot, we can see in notes section html tags are displayed. I think it's because icloud calendar considering entire message as text. Here I am looking for a solution to make text align with html.

Any help would be appreciated. Thanks in advance.


Solution

  • The ics spec RFC5545 doesn't specifically allow html in the event description. It suggests that ALTREP may point to an alternate HTML representation https://www.rfc-editor.org/rfc/rfc5545#section-3.2.1

    More importantly calendar applications may not support it and deal with any html in different ways: strip it or show raw html.

    See also Does icalendar support HTML and CSS? and https://icalevents.com/4019-ics-feed-generation-with-html/ (comment reposted as answer as suggested by hnh)