Reputation: 121
I'm trying to generate an .ics file using javascript. I am able to open the ics file but when I try to set an html in the body of the ics file the html is shown like plain text... Below is the parameter string I trying to use to set the description as html... Does anyone know what I'm doing wrong?
"BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
CLASS:PUBLIC
DESCRIPTION:
X-ALT-DESC;FMTTYPE=text\/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 08.01.0240.003">
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<A href="www.google.com" title="TEST">TEST</A></BODY>
</HTML>
DTSTART;VALUE=DATE:20160512T123232
DTEND;VALUE=DATE:20160512T123232
LOCATION:
SUMMARY;LANGUAGE=en-us:summary
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR"
Upvotes: 1
Views: 5461
Reputation: 660
The iCal spec actually explicitly specifies a way to include HTML in iCal:
DESCRIPTION;ALTREP="CID:<[email protected]>":Project...
The "ALTREP" property parameter value might point to a "text/html" content portion.
RFC 2445 Section 4.2.1 and RFC 5545 Section 3.2.1DESCRIPTION;ALTREP="http://www.wiz.org":The Fall...
RFC 2445 Section 4.2, at the very top of page 18The definition of ALTREP says: "The parameter specifies a URI that points to an alternate representation for a textual property value", so any URI scheme is valid. That means we can also use data:
URLs in there.
That means there is actually a specced way to store HTML descriptions in iCal.
The following is conforming to the spec:
DESCRIPTION;ALTREP="data:text/html;<h1>Some text</h1>":Some text
Upvotes: 3
Reputation: 4635
There are several issues with your example:
Bottom line:
Upvotes: 0
Reputation: 170
If you read iCalendar Protocol, using the ALTREP
property parameter you can accomplish so, even including html content. Now when the client take the calendar file, it process the content and take the data that it needs from the different calendar components and properties. So if the client use the ALTREP
property parameter it might render the content in the html format. I don't know if Outlook render the content following the ALTREP
param, maybe there is other client that do so. Maybe what you have to looking for is a client that render the content by its ALTREP
.
Hope it helps
Upvotes: 0