Closed matteomattei closed 3 years ago
From version 3.17.2 to version 3.17.3 (problem is still present in version 3.17.4) has been added an issue parsing line feed on the first line of a multi line value.
<?xml version="1.0" encoding="utf-8"?><n1:schedule-response xmlns:n1="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:"><n1:response><n1:request-status>2.0;Success</n1:request-status><n1:calendar-data>BEGIN:VCALENDAR PRODID:-//Inverse inc./SOGo 4.3.1//EN VERSION:2.0 METHOD:REPLY BEGIN:VFREEBUSY UID:e5718fd0-3094-11eb-9344-5316989fab61 DTSTAMP:20201127T094242Z DTSTART:20201128T133000Z DTEND:20211128T133000Z FREEBUSY;FBTYPE=BUSY:20201128T133000Z/20201128T143000Z FREEBUSY;FBTYPE=BUSY-TENTATIVE:20201128T130000Z/20201128T140000Z END:VFREEBUSY END:VCALENDAR</n1:calendar-data></n1:response><n1:response><n1:recipient>mailto:maurizio.mambrini@qboxmail.it</n1:recipient><n1:request-status>2.0;Success</n1:request-status><n1:calendar-data>BEGIN:VCALENDAR PRODID:-//Inverse inc./SOGo 4.3.1//EN VERSION:2.0 METHOD:REPLY BEGIN:VFREEBUSY UID:e5718fd0-3094-11eb-9344-5316989fab61 DTSTAMP:20201127T094242Z DTSTART:20201128T133000Z DTEND:20211128T133000Z FREEBUSY;FBTYPE=BUSY:20201128T130000Z/20201128T140000Z END:VFREEBUSY END:VCALENDAR</n1:calendar-data></n1:response></n1:schedule-response>
const fs = require('fs'); const parser = require('fast-xml-parser'); const buf = fs.readFileSync('freebusy.xml').toString(); let a = parser.parse(buf, {trimValues: false}); console.log(a['n1:schedule-response']['n1:response'][0]['n1:calendar-data']);
With version 3.17.3 and 3.17.4 the output is this:
BEGIN:VCALENDAR PRODID:-//Inverse inc./SOGo 4.3.1//EN VERSION:2.0 METHOD:REPLY BEGIN:VFREEBUSY UID:e5718fd0-3094-11eb-9344-5316989fab61 DTSTAMP:20201127T094242Z DTSTART:20201128T133000Z DTEND:20211128T133000Z FREEBUSY;FBTYPE=BUSY:20201128T133000Z/20201128T143000Z FREEBUSY;FBTYPE=BUSY-TENTATIVE:20201128T130000Z/20201128T140000Z END:VFREEBUSY END:VCALENDAR
With version 3.17.2 the output is correct:
Would you like to work on this issue?
Bookmark this repository for further updates.
I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.
Does #289 solve your issue?
Yes, version 3.17.5 fixes the issue. Thanks!!!
Description
From version 3.17.2 to version 3.17.3 (problem is still present in version 3.17.4) has been added an issue parsing line feed on the first line of a multi line value.
Input
Output
With version 3.17.3 and 3.17.4 the output is this:
expected data
With version 3.17.2 the output is correct:
Would you like to work on this issue?
Bookmark this repository for further updates.