Scrivener markdown exports without blank lines between paragraphs

I would have a look at this post, and probably more specifically the numbered checklist following, “If you want to give it a quick try…”, but the rest might be enlightening as well. I say that because it sounds like you are approaching Scrivener as a Markdown generator rather than a tool for writing with Markdown. To be fair it can generate a fair bit, but it does approach things from the fundamental concept of writing with Markdown first, and providing generation where it is convenient, second. Refer to Chapter 21, maybe starting at §21.4, where the core design philosophy is described. The following sections cover intended generation.

The method described in the linked post is a much better way of spacing paragraphs automatically, especially if stuff other than normal paragraphs are styled. For example, you wouldn’t want a code block to be double-spaced within it, or a Markdown table, or the YAML metadata block at the top of the file. Using a Replacement to replace one newline with two, or something even after compiling such as with awk, could very well damage interpretation of areas of the output document.

For each exported or compiled markdown file…

So to reiterate, I would very much consider doing such a step on the original text, so that you’re starting from the right place (well formed already) instead of trying to build systems to accommodate not doing so. The text editor supports regex (although for a simple thing like this you can use Opt-Return to insert newlines and run a simple duplication search and replace).

Lastly, do search the forum, and in particular the Scrivener > Markdown & LaTeX category. You will probably find most questions you might have discussions, such as: Does Scrivener convert italics & other special fonts?

1 Like