Compile is deleting my paragraph breaks

I’ve been pulling my hair with this for hours now. It took me a while to realize what was happening. I was trying to get the indents right and no matter what I did, my lines weren’t indenting. Turns out the issue wasn’t with my indentation, it was that Scrivener deleted my paragraph breaks when compiling my project. I can’t find out how to make this stop. After some testing, here’s what’s happening:

  • A single paragraph break gets deleted. The text just continues on the same line.
  • Two or more consecutive paragraph breaks become a single paragraph break.
  • A line break becomes a paragraph break
  • A line break with one or more paragraph breaks become an empty line (double paragraph break)

What’s going on and how can I make it stop?

Compile dialog, right-hand panel, gear icon: If “Convert MultiMarkdown to rich text in notes and text” is ON, turn it OFF.

Does that help?

Ah, yes! Yes it does. Thank you. It never occurred to me that this would be the problem.
The problem now is that I can’t use markdown when writing anymore. All throughout my project I have italics indicated like this. I haven’t written using markdown before, and now that you pointed it out to me, I guess that’s how markdown works. I need to use double breaks to create a paragraph break, and I guess there’s no standard way in markdown to create empty lines. How annoying.

What’s the easiest way of replacing all my markdown italics with rich text italics? Because I suppose there’s no way I can keep the markdown italics but not get the new line behavior?

If you want to keep using Markdown, you can play some games with search and replace, assuming that you’re compiling to a format that lets you edit afterwards like RTF or DOCX.

Instead of doing two paragraph breaks in a row, do paragraph break SOME TEXT THAT IS UNIQUE paragraph break. When I do something like this I usually use my initials. This keeps Scrivener from stripping out your extra paragraph breaks and leaves you with a unique string you can then load up in another editor and search for. Replace “paragraph break SOME TEXT THAT IS UNIQUE paragraph break” with “paragraph break paragraph break” and then you’re good.

Now, I haven’t played with this next suggestion, but some of the other folks here might know if it works – see if you can set a compile-time replacement (perhaps using a regex) to change the text above to a dual paragraph break? If the compile replacements fire after the conversion from Markdown, then that’s a way you can perform the entire operation in Scrivener.

That’s not a bad idea. I could do a regex that replaces every paragraph break with two paragraph breaks, and any empty line with a line break and a paragraph break (which seems to give me the blank line). Probably in the opposite order. That could work!

The compile regex solution didn’t work, unfortunately. Seems Scrivener does the markdown replace before the regex, so when it gets to the search and replace, the paragraph breaks are already gone. Too bad. I could of course run it on my actual project, but this way of handling paragraph breaks seems very cumbersome to me. I’d love to be able to mark italics and the like as “code”, but have paragraph breaks work normally, but I guess that’s not possible.

And it doesn’t look like Scrivener supports using formatting or styles in the search and replace box. This is a good reason to use markdown in the text! It allows for it to be searched for and manipulated with regex. As it is, it seems I have to go through my entire project and replace my markdown with a style. I’d rather use a style than just italics, because then I can always choose later to use bold or small caps or a different color instead.

It annoys me a bit that I have to think about formatting when I’m writing the text, instead of being able to do all of that at compilation, but you can’t have everything, I guess.

Do let me know if you know of a way to replace all my markdown with styles, though.

I write in MultiMarkdown routinely now. To deal with the need for double paragraph breaks, I just did a regex search and replace of one paragraph break with two. The “empty line” problem doesn’t come up in my writing, as I start a new document in Scrivener wherever I want an empty line, and Compile separators take care of it.

As far as switching asterisk italics markers for a style, no, there’s no convenient way to get this done. My best suggestion would be a regex search and replace, but done manually so that you can apply the style to each instance before searching for the next.

There are plenty more caveats in using the MultiMarkdown conversion option, but as you’ve decided to go with RTF and styles, I won’t go into them. :smiley: If you’re curious, I did some extensive write-ups on this in my blog. In general, if you don’t use Scrivener styles, are willing to use Markdown syntax for external links and for images, and are also willing to use MultiMarkdown syntax for simple tables, you can avoid the gotchas.

Good luck!