emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ICalendar export


From: Ihor Radchenko
Subject: Re: ICalendar export
Date: Wed, 13 Sep 2023 08:00:36 +0000

Henrik Frisk <frisk.h@gmail.com> writes:

> Recently (not sure when) the ics output came out malformed and a newline is
> omitted between the end of one event and the beginning of another:
>
> END:VEVENT
> BEGIN:VEVENT
>
> is now
>
> END:VEVENTBEGIN:VEVENT
>
> I can't figure out wha the pattern is, for some events the output is
> correct.
>
> This is on Org mode version 9.7-pre release_9.6.8-719-gf299fb and emacs 29.1

We recently did some major changes to comply better to the icalendar
specs and introduced new feature. As it usually goes, major changes can
easily introduce new bugs.

Does the attached patch fix the problem for you?

>From 5ab376c558cbd0c1dcdbba99b4a42ff11e27418a Mon Sep 17 00:00:00 2001
Message-ID: 
<5ab376c558cbd0c1dcdbba99b4a42ff11e27418a.1694591956.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Wed, 13 Sep 2023 10:58:15 +0300
Subject: [PATCH] ox-icalendar: Ensure that entries in icalendar end with a
 newline

* lisp/ox-icalendar.el (org-icalendar--vevent):
(org-icalendar--vtodo): Make sure that there is a newline after the
exported VEVENT and VTODO.

Reported-by: Henrik Frisk <frisk.h@gmail.com>
Link: 
https://orgmode.org/list/CAO0LSb4aQhUMny4xr=1LB3t5F-K-WnjK1zc+qR7Jy+69vr2wpw@mail.gmail.com
---
 lisp/ox-icalendar.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 980bb0ed3..20efad243 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -809,7 +809,7 @@ (\"PUBLIC\", \"CONFIDENTIAL\", and \"PRIVATE\") are 
predefined, others
            "CATEGORIES:" categories "\n"
            ;; VALARM.
            (org-icalendar--valarm entry timestamp summary)
-           "END:VEVENT")))
+           "END:VEVENT\n")))
 
 (defun org-icalendar--repeater-type (elem)
   "Return ELEM's repeater-type if supported, else warn and return nil."
@@ -952,7 +952,7 @@ (defun org-icalendar--vtodo
                    (if (eq (org-element-property :todo-type entry) 'todo)
                        "NEEDS-ACTION"
                      "COMPLETED"))
-           "END:VTODO")))
+           "END:VTODO\n")))
 
 (defun org-icalendar--valarm (entry timestamp summary)
   "Create a VALARM component.
-- 
2.42.0

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]