

Some text 
it is being rendered as
<p></p>
<figure> ... </figure
<p></p>
<figure> ... </figure
<p></p>
Some text <figure>...</figure>
<p></p>
Those empty
tags are a bit of a nuisance, I would wish I could avoid them.
The “Some text” part is a bit more complicated. I wonder what a correct way to render this should look like.
Try using ``` to surround code blocks like Markdown too. I assume you have more than one newline in your markdown. That might result in empty paragraphs. But exactly that part of the question is hidden
The short code was messed up, the opening figure tag had to go before the leading with clause, which had to end just before the closing figure tag. Like so:
The “idea” behind this <p>-Tag is, that an image is an inline tag. There is also a bug report open about this:
I don’t think there is a way yet to remove it. Maybe setting one of these configuration parameters will change things, but I couldn’t find documentation for them (false is the default):