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--event-to-org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/test-calendar-sync--event-to-org.el') diff --git a/tests/test-calendar-sync--event-to-org.el b/tests/test-calendar-sync--event-to-org.el index e6609e20..96ce49d5 100644 --- a/tests/test-calendar-sync--event-to-org.el +++ b/tests/test-calendar-sync--event-to-org.el @@ -26,7 +26,11 @@ :status "accepted" :url "https://meet.google.com/abc-defg-hij"))) (let ((result (calendar-sync--event-to-org event))) - (should (string-match-p "\\* Team Standup" result)) + ;; Verify heading comes before timestamp + (should (string-match "\\* Team Standup" result)) + (let ((heading-pos (match-beginning 0))) + (should (string-match "<[0-9]" result)) + (should (< heading-pos (match-beginning 0)))) (should (string-match-p ":PROPERTIES:" result)) (should (string-match-p ":LOCATION: Conference Room A" result)) (should (string-match-p ":ORGANIZER: John Smith" result)) -- cgit v1.2.3