~
$ jrnl -v
jrnl version v2.2
~
Installed via brew install jrnl on 2020-03-16 (Mon).
Software:
~~~
System Software Overview:
System Version: macOS 10.14.6 (18G3020)
Kernel Version: Darwin 18.7.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: MKO
User Name: Marek Kowalczyk (marekkowalczyk)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 4 days 2:25
~~~
jrnl --export markdown -o jrnl.md produces
~~~
Donec diam nisl, pellentesque at mi vel, sodales dapibus lectus.
Aenean suscipit euismod vulputate.
~~~
Expected behavior
~~~
Donec diam nisl, pellentesque at mi vel, sodales dapibus lectus.
Aenean suscipit euismod vulputate.
~~~
Yeah, that's fair. Technically, the markdown spec doesn't require a newline, but many parsers do, so we should probably just add a line there to be more widely compatible.
A workaround is to disable the requirement for Pandoc to have a blank line before a heading. The extension to be blocked is blank_before_header with a - (dash) before its invocation.
The entire command is:
pandoc --from=markdown-blank_before_header jrnl.txt -o jrnl.pdf.
In case you need a pandoc-compatible MD file with \n\n before headers:
pandoc --from=markdown-blank_before_header jrnl.txt -o jrnl.md
This is happening because the entries don't end with a newline. To fix it, it's a oneline addition to add a blank line after each entry.
But does the "fix" need to turn itself "off" for entries that do end with a newline? If we don't do that, then you're bound to get a mix of single and double empty lines above the level 3 headers...
@MinchinWeb You might want to use sed after adding a newline to remove superfluous newlines. A bit crude but guarenteed to work.