If a line in the code contains a hash-symbol then an additional empty line is automatically inserted. This seems to be independent of the selected languagre:
<pre class="decode-attributes:false trim-whitespace:false lang:sh decode:true show_mixed:false">#!/bin/sh
Will be shown as
This empty line is not visible in the preview nor in the unformatted view.