bastibe / org-journal

A simple org-mode based journaling mode
BSD 3-Clause "New" or "Revised" License
1.24k stars 123 forks source link

Multi-line file header is getting split and mixed with entry #360

Closed Alexander-Miller closed 3 years ago

Alexander-Miller commented 3 years ago

Describe the bug When org-journal-file-header is set to a value containing newlines only the first line stays at the top of the file, the rest becomes mixed up with the first entry.

To Reproduce

Configure org-journal like this:

(setf
 org-journal-file-type 'weekly
 org-journal-file-header "#+TITLE: Log %Y-%m-%d\n#+STARTUP: showall"
 org-journal-date-prefix "\n* ")

Call org-journal-new-entry.

The content of the journal buffer looks like this, the #+STARTUP header is inside the first entry:

#+TITLE: Log 2021-08-07

* Samstag, 07.08.2021
:PROPERTIES:
:CREATED:  20210807
:END:
#+STARTUP: showall
** 14:46 

Expected behavior The header properties should all be at the top:

#+TITLE: Log 2021-08-07
#+STARTUP: showall

* Samstag, 07.08.2021
:PROPERTIES:
:CREATED:  20210807
:END:
** 14:46 

Desktop (please complete the following information):