Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when DESCRIPTION field has newlines #2

Open
io12 opened this issue Jan 24, 2021 · 2 comments
Open

Fails when DESCRIPTION field has newlines #2

io12 opened this issue Jan 24, 2021 · 2 comments

Comments

@io12
Copy link

io12 commented Jan 24, 2021

When the DESCRIPTION field of an ical has line breaks (not \n escapes, but actual newline characters), this tool discards the rest of the description. To reproduce this, take any ical file with a description and insert a line break in the description.

@msherry
Copy link
Owner

msherry commented Jan 25, 2021

Is it valid to allow literal newlines, rather than \n characters? I'm looking at https://tools.ietf.org/html/rfc5545#section-3.3.11, and TSAFE-CHAR seems to skip over 0x0A and 0x0D, which represent \n and \r, respectively.

@io12
Copy link
Author

io12 commented Jan 25, 2021

The ics npm package inserts literal newlines to break up long lines. Based on the usage, it seems like they're supposed to be ignored, not treated as a newline inside the description.

Example to reproduce

const ics = require('ics')

const event = {
    start: [2018, 5, 30, 6, 30],
    duration: { hours: 6, minutes: 30 },
    title: 'Bolder Boulder',
    description: 'Annual 10-kilometer run in Boulder, ColoradoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAÁ',
    location: 'Folsom Field, University of Colorado (finish line)',
    url: 'http://www.bolderboulder.com/',
    geo: { lat: 40.0095, lon: 105.2669 },
    categories: ['10k races', 'Memorial Day Weekend', 'Boulder CO'],
    status: 'CONFIRMED',
    busyStatus: 'BUSY',
    organizer: { name: 'Admin', email: '[email protected]' },
    attendees: [
        { name: 'Adam Gibbons', email: '[email protected]', rsvp: true, partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' },
        { name: 'Brittany Seaton', email: '[email protected]', dir: 'https://linkedin.com/in/brittanyseaton', role: 'OPT-PARTICIPANT' }
    ]
}

ics.createEvent(event, (error, value) => {
    if (error) {
        console.log(error)
        return
    }

    console.log(value)
})

Output

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:adamgibbons/ics
METHOD:PUBLISH
X-PUBLISHED-TTL:PT1H
BEGIN:VEVENT
UID:284815c4-406b-4c75-be29-51d52426c8f9
SUMMARY:Bolder Boulder
DTSTAMP:20210125T222300Z
DTSTART:20180530T063000Z
DESCRIPTION:Annual 10-kilometer run in Boulder\, ColoradoAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA                                                                            
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAÁ
URL:http://www.bolderboulder.com/
GEO:40.0095;105.2669
LOCATION:Folsom Field\, University of Colorado (finish line)
STATUS:CONFIRMED
CATEGORIES:10k races,Memorial Day Weekend,Boulder CO
ORGANIZER;CN=Admin:mailto:[email protected]
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Adam Gibbons:m
        ailto:[email protected]
ATTENDEE;RSVP=FALSE;ROLE=OPT-PARTICIPANT;DIR=https://linkedin.com/in/britta
        nyseaton;CN=Brittany Seaton:mailto:[email protected]
DURATION:PT6H30M
END:VEVENT
END:VCALENDAR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants