-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optional/generic serializing #97
Comments
@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:[email protected]
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? |
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: 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:
I am not sure how:
Is being wrapped... I get:
I was attempting to add an override for that, however unless it's found in the RFCs it's out of scope. |
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.
The text was updated successfully, but these errors were encountered: