File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -216,8 +216,11 @@ module.exports = function (options) {
216216 doc : 'https://tools.ietf.org/html/rfc4791#section-9.6' ,
217217 async resp ( { event, ctx, calendar } ) {
218218 const ics = await options . data . buildICS ( ctx , event , calendar ) ;
219+ // Wrap iCalendar data in CDATA to prevent XML parsing issues
220+ // This ensures that the iCalendar content is treated as character data
221+ // and not parsed as XML, preventing malformed XML errors
219222 return {
220- [ buildTag ( cal , 'calendar-data' ) ] : { $cdata : ics }
223+ [ buildTag ( cal , 'calendar-data' ) ] : { ' $cdata' : ics }
221224 } ;
222225 }
223226 } ,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ module.exports = function (options) {
3737 'D:getetag' : options . data . getETag ( ctx , event )
3838 } ,
3939 {
40- 'CAL:calendar-data' : ics
40+ 'CAL:calendar-data' : { '$cdata' : ics }
4141 }
4242 ] ) ;
4343 } ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ module.exports = function (options) {
2323 'D:getetag' : options . data . getETag ( ctx , calendar )
2424 } ,
2525 {
26- 'CAL:calendar-data' : ics
26+ 'CAL:calendar-data' : { '$cdata' : ics }
2727 }
2828 ] ) ;
2929 }
@@ -52,7 +52,7 @@ module.exports = function (options) {
5252 'D:getetag' : options . data . getETag ( ctx , calendar )
5353 } ,
5454 {
55- 'CAL:calendar-data' : ics
55+ 'CAL:calendar-data' : { '$cdata' : ics }
5656 }
5757 ] ) ;
5858 } ;
You can’t perform that action at this time.
0 commit comments