Closed masterElmar closed 1 month ago
@masterElmar I have a busy couple days I will try dig in over the next 8 days.
Anything new about this request?
Do you think you could provide a small sample of a complete file I can use as a test?
This is one Example from Thunderbird:
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-TZINFO:Europe/Berlin[2024a]
BEGIN:STANDARD
TZOFFSETTO:+010000
TZOFFSETFROM:+005328
TZNAME:Europe/Berlin(STD)
DTSTART:18930401T000000
RDATE:18930401T000000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20240929T120640Z
LAST-MODIFIED:20240929T120731Z
DTSTAMP:20240929T120731Z
UID:d23cef0d-9e58-43c4-9391-5ad8483ca346
SUMMARY:Test Event
DTSTART;TZID=Europe/Berlin:20240929T144500
DTEND;TZID=Europe/Berlin:20240929T154500
TRANSP:OPAQUE
LOCATION:Github
DESCRIPTION;ALTREP="data:text/html,I%20want%20
a%20custom%20linkout%20for%20
Thunderbird.%3Cbr%3EThis%20is%20the%20Github%20
%3Ca%20href%3D%22https%3A%2F
%2Fgithub.com%2Farran4%2Fgolang-ical%2Fissues%2F97%22
%3EIssue%3C%2Fa%3E.":I
want a custom linkout for Thunderbird.\nThis is the Github Issue.
END:VEVENT
END:VCALENDAR
This is one from Google:
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Test
X-WR-TIMEZONE:Europe/Berlin
BEGIN:VEVENT
DTSTART:20240929T124500Z
DTEND:20240929T134500Z
DTSTAMP:20240929T121653Z
UID:al23c5kr943d42u3bqoqrkf455@google.com
CREATED:20240929T121642Z
DESCRIPTION:I want a custom linkout for Thunderbird.<br>This is the Github
<a href="https://github.com/arran4/golang-ical/issues/97">Issue</a>.
LAST-MODIFIED:20240929T121642Z
LOCATION:GitHub
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Test Event
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
Sorry that these files are Code Sections, but Github dont support ics file type.
Hope that these are examples that you need? If i could support or help you let me know. 😊 Thank you for the time and effort.
Sorry that these files are Code Sections, but Github dont support ics file type.
All good. I will build tests around these to ensure they serialize and de-serialize. Definitely out of scope is building a html parser in it though.. Although I would like to, but I would need funding. :P
All good. I will build tests around these to ensure they serialize and de-serialize. Definitely out of scope is building a html parser in it though.. Although I would like to, but I would need funding. :P
Yeah, that's not the task even if there could be more special encodings in the ALTREP so an optional flag that enables or disables the default serializing or a custom encoder that could be pasted into your current ical decoding library.
Fixing this would be very helpful for me🫤
Okay I took a good look at this...
This looks like a spec error:
https://icalendar.org/iCalendar-RFC-5545/3-2-1-alternate-text-representation.html
Well where it is falling short.
I have attempted to make the first pass of changes for this here:
https://github.com/arran4/golang-ical/pull/106
Please review the PR!!! (By testing it) -- I might need to make some more changes to it.. I had a lot of trouble with the parameter and word wrapping.
Please checkout: cmd/issues/test97_1/main.go
Where I was able to generate the output:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//Golang ICS Library
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-X-:Europe/Berlin[2024a]
BEGIN:STANDARD
TZOFFSETTO:+010000
TZOFFSETFROM:+005328
TZNAME:Europe/Berlin(STD)
DTSTART:18930401T000000
RDATE:18930401T000000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:d23cef0d-9e58-43c4-9391-5ad8483ca346
CREATED:20240929T120640Z
LAST-MODIFIED:20240929T120731Z
DTSTAMP:20240929T120731Z
SUMMARY:Test Event
DTSTART;TZID=Europe/Berlin:20240929T144500
DTEND;TZID=Europe/Berlin:20240929T154500
TRANSP:OPAQUE
LOCATION:Github
DESCRIPTION;ALTREP="data:text/html,I%20want%20a%20custom%20linkout%20for%20
Thunderbird.%3Cbr%3EThis%20is%20the%20Github%20%3Ca%20href%3D%22https%3A%2
F%2Fgithub.com%2Farran4%2Fgolang-ical%2Fissues%2F97%22%3EIssue%3C%2Fa%3E."
:I want a custom linkout for Thunderbird.\nThis is the Github Issue.
END:VEVENT
END:VCALENDAR
I am not sure how:
DESCRIPTION;ALTREP="data:text/html,I%20want%20
a%20custom%20linkout%20for%20
Thunderbird.%3Cbr%3EThis%20is%20the%20Github%20
%3Ca%20href%3D%22https%3A%2F
%2Fgithub.com%2Farran4%2Fgolang-ical%2Fissues%2F97%22
%3EIssue%3C%2Fa%3E.":I
want a custom linkout for Thunderbird.\nThis is the Github Issue.
Is being wrapped...
I get:
DESCRIPTION;ALTREP="data:text/html,I%20want%20a%20custom%20linkout%20for%20
Thunderbird.%3Cbr%3EThis%20is%20the%20Github%20%3Ca%20href%3D%22https%3A%2
F%2Fgithub.com%2Farran4%2Fgolang-ical%2Fissues%2F97%22%3EIssue%3C%2Fa%3E."
:I want a custom linkout for Thunderbird.\nThis is the Github Issue.
I was attempting to add an override for that, however unless it's found in the RFCs it's out of scope.
Example: The following is an example of this property referencing
textual contact information:
CONTACT:Jim Dolittle\, ABC Industries\, +1-919-555-1234
The following is an example of this property with an alternate
representation of an LDAP URI to a directory entry containing the
contact information:
CONTACT;ALTREP="ldap://example.com:6666/o=ABC%20Industries\,
c=US???(cn=Jim%20Dolittle)":Jim Dolittle\, ABC Industries\,
+1-919-555-1234
The following is an example of this property with an alternate
representation of a MIME body part containing the contact
information, such as a vCard [RFC2426] embedded in a text/
directory media type [RFC2425]:
CONTACT;ALTREP="CID:part3.msg970930T083000SILVER@example.com":
Jim Dolittle\, ABC Industries\, +1-919-555-1234
Found this example at https://www.ietf.org/rfc/rfc5545.txt and as far as i tested the other altreps it works.
Merged!
As iam working on a calendar/ics implementation for mozilla thunderbird and google calendar. For the Description field they are using html representation within google calendar:
And for mozilla thunderbird they using the altrep property:
When iam adding the property
I need the optional functionality to disable the serialize function for the altrep because thunderbird uses its own serializer url/html
data:text/html, + url.PathEscape(htmlDescription)
I already tried to "override" the serializer, but this gets really complecated and it would be a nice optional to disable/generic/replace it for a component or property.
If anyone can help me with this problem, I would be very pleased. Many thanks for the great ical library.