Skip to content

Comments

fix: improve icalendar export#1064

Open
rros wants to merge 9 commits intoFossifyOrg:mainfrom
rros:feature/icalendar-export
Open

fix: improve icalendar export#1064
rros wants to merge 9 commits intoFossifyOrg:mainfrom
rros:feature/icalendar-export

Conversation

@rros
Copy link
Contributor

@rros rros commented Feb 18, 2026

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

The implementation of the IcsExporter class has been changed to do proper normalizing, escaping and line folding as specified in RFC 5545. I created functions to write content lines using the proper line endings and to do line folding for all content lines, not just descriptions.
Also there is a method added to write TEXT properties, which have additional escaping rules for newlines and characters like ',' and ';'.

Tests performed

I did some tests with long lines, line breaks and characters like , and ; which should be escaped in the output.

For example a to-do with a long title and a long description:
Before

BEGIN:VCALENDAR
PRODID:-//Fossify//NONSGML Event Calendar//EN
VERSION:2.0
BEGIN:VTODO
SUMMARY:This task has a very long title and doesn't fit on a single content line. It must be folded properly
UID:6272ad534681402ca13deee8c9d2a5811771114583194
X-FOSSIFY-CATEGORY-COLOR:-8417344
CATEGORIES:Lokale agenda
LAST-MODIFIED:20260215T234152Z
DTSTART;VALUE=DATE:20260215
DTSTAMP:20260218T181614Z
DESCRIPTION:The description is also way too long for a single content line and must als
 o be folded properly\n\nNewlines should also be properly handled.\n\nAs wel
 l as ";" and ","
BEGIN:VALARM
DESCRIPTION:Herinnering
ACTION:DISPLAY
TRIGGER:-P0DT0H10M0S
END:VALARM
END:VTODO
END:VCALENDAR
ignoreImageMinify

After

BEGIN:VCALENDAR
PRODID:-//Fossify//NONSGML Event Calendar//EN
VERSION:2.0
BEGIN:VTODO
SUMMARY:This task has a very long title and doesn't fit on a single content
  line. It must be folded properly
UID:6272ad534681402ca13deee8c9d2a5811771114583194
X-FOSSIFY-CATEGORY-COLOR:-8417344
CATEGORIES:Lokale agenda
LAST-MODIFIED:20260215T234152Z
DTSTART;VALUE=DATE:20260215
DTSTAMP:20260218T095821Z
DESCRIPTION:The description is also way too long for a single content line 
 and must also be folded properly\n\nNewlines should also be properly handl
 ed.\n\nAs well as "\;" and "\,"
BEGIN:VALARM
DESCRIPTION:Herinnering
ACTION:DISPLAY
TRIGGER:-P0DT0H10M0S
END:VALARM
END:VTODO
END:VCALENDAR
afbeelding

I used https://icalendar.org/validator.html to validate the results.

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

@rros rros requested a review from naveensingh as a code owner February 18, 2026 18:19
@rros rros force-pushed the feature/icalendar-export branch from f610be3 to dc1ab69 Compare February 18, 2026 20:57
@rros rros force-pushed the feature/icalendar-export branch from dc1ab69 to db5728f Compare February 22, 2026 14:35
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

Successfully merging this pull request may close these issues.

Export file can't be importet to Thunderbird because of wrong escape sequences

1 participant