Peltoche / ical-rs

Rust parser for ics (rfc5545) and vcard (rfc6350)
Apache License 2.0
110 stars 21 forks source link

vCard property group support #59

Open rolisv opened 10 months ago

rolisv commented 10 months ago

Hi @Peltoche

It looks like property groups are not supported.

From the spec https://www.rfc-editor.org/rfc/rfc6350#section-3.3 on page 6:

...
   contentline = [group "."] name *(";" param) ":" value CRLF
...
   group = 1*(ALPHA / DIGIT / "-")
...

And then page 7:

The group construct is used to group related properties together. The group name is a syntactic convention used to indicate that all property names prefaced with the same group name SHOULD be grouped together when displayed by an application. It has no other significance. Implementations that do not understand or support grouping MAY simply strip off any text before a "." to the left of the type name and present the types and values as normal.

So having vCard property line:

gr1.FN:Bob

The expectation would be something like:

let p = vcard.get_property("FN").unwrap();
assert_eq!(p.name, "FN");
assert_eq!(p.group, Some("gr1"));

IMHO, the key point here is that the property name should be "FN" and not "gr1.FN".

Is this functionality being considered? I could submit a PR.

Cheers