From 7b7af0423813918ccda28f12022892386b965d6f Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 17 Sep 2024 20:25:32 +0200 Subject: Cleanup description \n escape --- gnus-icalendar-request.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'gnus-icalendar-request.el') diff --git a/gnus-icalendar-request.el b/gnus-icalendar-request.el index 95256bd..4711be1 100644 --- a/gnus-icalendar-request.el +++ b/gnus-icalendar-request.el @@ -51,16 +51,12 @@ role." (with-slots (summary description location organizer recur uid start-time end-time req-participants opt-participants) event (let ((dtstamp (format-time-string "DTSTAMP:%Y%m%dT%H%M%SZ" nil t)) ;; current UTC time (summary (format "SUMMARY:%s" summary)) - (description (when (and (stringp description) (not (string-empty-p description))) + (description (when (and (stringp description) + (not (string-empty-p description))) (format "DESCRIPTION:%s" - (with-temp-buffer - (insert description) - (beginning-of-buffer) - (while (re-search-forward "\n" nil t) - (replace-match "\\n" t t)) - (buffer-string))))) ;; TODO: How to do this properly? - (dtstart (format-time-string "DTSTART:%Y%m%dT%H%M%SZ" start-time t)) ;; start-time in UTC - (dtend (format-time-string "DTEND:%Y%m%dT%H%M%SZ" end-time t)) ;; end-time in UTC + (string-replace "\n" "\\n" description)))) + (dtstart (format-time-string "DTSTART:%Y%m%dT%H%M%SZ" start-time t)) ;; in UTC -> suffix "Z" + (dtend (format-time-string "DTEND:%Y%m%dT%H%M%SZ" end-time t)) (attendee (gnus-icalendar--create-attendee-list req-participants opt-participants)) (location (when (and (stringp location) (not (string-empty-p location))) (format "LOCATION:%s" location))) -- cgit v1.2.3