Closed KirillZet closed 1 week ago
Will do a small test now. See if it can be quickly resolved.
@KirillZet The issue is the _
in this line:
X-SCHEDULE_VERSION-ID:8
Tests:
Which should follow the grammar: https://datatracker.ietf.org/doc/html/rfc5545
(I have extracted it to the relevant parts from section 3.1)
name = iana-token / x-name
x-name = "X-" [vendorid "-"] 1*(ALPHA / DIGIT / "-")
vendorid = 3*(ALPHA / DIGIT)
Alpha and digit are defined in:
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
DIGIT = %x30-39
Which I know sucks as an answer.
How much influence do you have over this choice of character? I will see if we can find a solution. It's not per-say a "bug" in this but I do feel that if a work around is possible I could try offer it.
I don't know ical.net
should we ping the developer? https://github.com/ical-org/ical.net
It seems, that your provided examples are the same
Hah.. Clipboard failure.
Try one of those against working: https://github.com/arran4/golang-ical/blob/5670d8a3f3650007bb5b3b827b7a3aead774480d/testdata/issue111/vevent2-no-desc.ics
Remember, always ^C
at least 2 times. :P
Thanks for the help)
I just replaced this line everywhere X-SCHEDULE_VERSION-ID:8
, with this X-SCHEDULE-VERSION-ID
, and everything parsed as it should.
bodyString = strings.Replace(bodyString, "X-SCHEDULE_VERSION-ID:8", "X-SCHEDULE-VERSION-ID:8", -1)
I think everyone who faces the same problem can solve it this way. It's a bit of a crutch, but it works)
Could be in func ParseCalendar(r io.Reader) (*Calendar, error)
replace string before parsing to avoid problems with this format
I think this ticket indicates 2 issues with my library:
So expect improvements.
@KirillZet were you able to find where the invalid token (name X-SCHEDULE_VERSION-ID:8
) was being inserted? What's generating it?
I think this ticket indicates 2 issues with my library:
- Bad error reporting; which is being worked on: https://github.com/arran4/golang-ical/pull/73
- Ability to make the lexer more flexible, which I have started in the blocked: https://github.com/arran4/golang-ical/pull/107 via option args. (As there is no consequence of adding that character to the token on the lexer side.)
So expect improvements.
@KirillZet were you able to find where the invalid token (name
X-SCHEDULE_VERSION-ID:8
) was being inserted? What's generating it?
The API from which I get the link to ical belongs to my university, so there's no way for me to see what's actually going on there.
Ah. I guess all you can do is log it. Good luck.
Current Behavior:
Hello, I'm trying to parse a calendar using your library. Calendar obtained via http. Here's my code:
Calendar is nil and error “malformed calendar; expected end”
Expected Behavior:
I tested parsing this calendar(from the same link) in python using the library
icalendar
, everything parsed as I needed it to.Steps To Reproduce:
Minimal Example ical extract:
Anything else:
icalURL := "http://english.mirea.ru/schedule/api/ical/1/248"