Scrivener -> MMD -> Pandoc -> ICML -> Indesign... line break issues

Hello, Scrivener.
I debated putting this in the MMD forum, but this one seems more appropriate.
I’m using the MMD + Pandoc compile method to get an ICML file for importing text written and compiled in Scrivener to InDesign for a book layout. I’ve run across the famous “hard line break” issue in MMD/Pandoc. Reading from the Pandoc manual:

Of course, I actually need hard line breaks for proper formatting. The “easy” way to deal with this would be just to add two returns at the end of each paragraph, but with over 450,000 words in three different books to deal with, that’s not practical to do (or undo afterwards, which I have to do for other formatting purposes).
So the next thing I would try, also from the Pandoc manual:

Alright, so in the Scrivener compile dialogue for MultiMarkDown under the “Processing” section in “Post-process on command line” I have this for “arguments”:

-t icml+hard_line_breaks -s <$inputfile> -o <$outputname>.icml

Alas, this does not seem to do the trick.
It seems there’s some solution lurking out there, since this feature seems to be specifically contemplated by Pandoc / Scrivener. Has anyone figured out a way to manage it without typing 10,000 carriage returns?

Not as such. But instead of typing 10,000 carriage returns, it is possible to search for single carriage returns and replace with double carriage returns. Can easily be undone, or done solely for a compile-version of a project.

And if compiling to a MMD format, you could try replacements during compile: one return for two.

Slàinte mhòr.

Does it work if you first compile manually to markdown, and then run the Pandoc command in the terminal? This is the first step to see where the problem may lie…

You could also use regex replacements in the compile system to replace single with double line breaks? Would that work, or do you also use single linebreaks in lists/tables etc.? It would be possible to come up with some smarter replacements to handle these issues too (specific regex matching should solve these cases).

This turned out to be exactly the trick. It has the added benefit of leaving the original text unchanged as well.
The trick is to realise (as has been said elsewhere in this forum) that the replacement fields in the compile configuration screens won’t show hidden characters. On macos you have to use “option-return” and trust that it’s actually in there (since you can’t see it).
So now text compiles and exports to ICML format for perfect placement/importing into InDesign. Formatting is preserved. All is right with the world.
Thanks L&L/Scrivener!

[option][return] is one way to handle replacing newline characters, but as a FYI if you enable the regex toggle in the replacement you can also use backslash commands like \n to find and replace newlines. Regex (regular expressions) are a very powerful to do very specific replacements, and there are great online tools to help with their creation: regex101.com/r/BFDJxl/1