Dont render blank blocks

Very similar to #217. This one also has lots of tests. We should coordinate better :-)

@hornairs, @boourns, @fw42, @camilo, @dylanahsmith, @arthurnn