kewisch / ical.js

Javascript parser for ics (rfc5545) and vcard (rfc6350) data
https://kewisch.github.io/ical.js/
Mozilla Public License 2.0
989 stars 137 forks source link

Can't parse vCards with addresses starting with "LV=" #402

Closed tasn closed 5 months ago

tasn commented 5 years ago

The title is a bit specific, but it can't parse any vCards with addresses starting with anything that resembles a param.

Example vCard:

BEGIN:VCARD
VERSION:4.0
PRODID:-//EteSync//com.etesync.syncadapter/1.4.11 ez-vcard/0.10.5
UID:219cd42b-0d88-4fb2-8202-e57236918c96
ADR;LABEL="LV=, County Gates\nBH1 2NF Bournemouth\nUK";TYPE=home:;;LV=\, Co
 unty Gates;Bournemouth;;BH1 2NF;UK
EMAIL;PREF=1;TYPE=home:LV=.documents@lv.com
FN:Liverpool Victoria (LV) Insurance Insurance
N:Insurance;Liverpool Victoria (LV) Insurance;;;
REV:20190721T133712Z
TEL:080-003-22577
END:VCARD

Error:

ParserError: Missing parameter value in 'ADR;TYPE=home;LABEL="LV=, County Gates\nBH1 2NF Bournemouth\nUK":;;LV=\, County Gates;Bournemouth;;BH1 2NF;UK'

The vCard seems fine to me, with thunderbird and ez-vcard also handling it without any issues. It looks like this library is trying to parse the value as if it was a parameter. I haven't been able to find anything conclusive in the RFC section about ADR and in general, but I think iCal.js is misbehaving.

kewisch commented 5 months ago

This seems to work now. There have been some more recent changes that fix escaping.