How to remove the extra line before a numbered list

When I compile an ebook to .mobi (Kindle) Scrivener add an extra empty line before any numbered list (see attachment)

Is it possible to remove that?

That’s just what HTML looks like by default, if you want to make adjustments to the underlying behaviour you need to use CSS. The easiest way to do that from Scrivener is in the Layouts compile option pane. Enable script formatting (don’t worry, it won’t actually change your formatting) and click the Customize CSS… button. Delete the stuff that is in there and add something like the following:

ol, ul { margin-top: 0em; }

I haven’t tested that on an actual Kindle to be clear, but that’s how you would solve it with HTML+CSS, and that instruction will be inserted into the source files.

Another approach is to adjust the source files themselves, which will of course give you much more power over the whole compile process. In the KindleGen pane, enable Save the source files in a folder with the exported Kindle file.

If you’ve never modified the source like this before, what you do when you’re ready to test is open the OPF file, in that source file folder, with KindlePreviewer. It will turn the source folder into a Mobi file using the same process Scrivener uses. So basically this option gives you the ability to step into the production sequence and give you absolute control over the output process.