emersion / go-ical

An iCalendar library for Go
MIT License
52 stars 10 forks source link

Properties defined with Props.Set() aren't escaped #7

Open Dynom opened 3 years ago

Dynom commented 3 years ago

In line of our earlier discussion, escaping should happen without the user having to think about it. At the moment this isn't yet the case. The following two pieces of code have a different result:

e.Props.Set(&ical.Prop{
    Name:  ical.PropDescription,
    Value: `Hello world!\n-:-;`,
})
// produces: Hello world!\n-:-;
e.Props.SetText(ical.PropDescription, `Hello world!\n-:-;`)
// produces: Hello world!\\n-:-\;