From 00ddf74b232b0762baa7826e62f6765d087041fb Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 5 Feb 2026 16:10:09 -0600 Subject: fix(calendar-sync): fix heading order, continuation lines, and exception text cleaning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three bugs found during manual verification of calendar sync output: 1. Heading/timestamp order reversed in event-to-org — nreverse pattern put timestamp before the org heading. Swap initial list order. 2. get-property continuation line regex broken — the ^ anchor in "^\n[ \t]" prevented matching at the correct position, truncating long DESCRIPTION values at the first ICS line fold. Remove anchor, add explicit position check (matching get-all-property-lines pattern). 3. collect-recurrence-exceptions didn't clean text — exception instances got raw ICS text (literal \n, HTML tags) replacing the cleaned base event text. Wrap summary/description/location in clean-text. --- tests/test-calendar-sync--get-property.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/test-calendar-sync--get-property.el') diff --git a/tests/test-calendar-sync--get-property.el b/tests/test-calendar-sync--get-property.el index 8b71f8e3..20551860 100644 --- a/tests/test-calendar-sync--get-property.el +++ b/tests/test-calendar-sync--get-property.el @@ -133,6 +133,26 @@ (should (equal (calendar-sync--get-property event "DESCRIPTION") "Tasks: setup; review; deploy"))) (test-calendar-sync--get-property-teardown))) +(ert-deftest test-calendar-sync--get-property-boundary-continuation-lines-joined () + "Test extracting property value with RFC 5545 continuation lines. +Folded lines start with a space or tab and should be joined." + (test-calendar-sync--get-property-setup) + (unwind-protect + (let ((event "BEGIN:VEVENT\nDESCRIPTION:This is a long\n description that spans\n multiple lines\nSUMMARY:Test\nEND:VEVENT")) + (should (equal (calendar-sync--get-property event "DESCRIPTION") + "This is a longdescription that spansmultiple lines"))) + (test-calendar-sync--get-property-teardown))) + +(ert-deftest test-calendar-sync--get-property-boundary-continuation-with-html () + "Test that HTML tags split across continuation lines are fully captured." + (test-calendar-sync--get-property-setup) + (unwind-protect + (let ((event "BEGIN:VEVENT\nDESCRIPTION:Created by link here\nEND:VEVENT")) + (let ((value (calendar-sync--get-property event "DESCRIPTION"))) + (should (string-match-p "example.com" value)) + (should (string-match-p "" value)))) + (test-calendar-sync--get-property-teardown))) + ;;; Error Cases (ert-deftest test-calendar-sync--get-property-error-missing-property-returns-nil () -- cgit v1.2.3