We just rolled out a new MergeSettings property that can be used to remove a complete line, if this line consists of empty merge fields only.
Consider the following template segment:
The following class is our data source for the merge process:
When the merge field blank is not used (is empty), an empty blank line will be rendered:
When the removeEmptyLines property is set to true, this empty line gets removed when merging the document:
Read more about the optional MergeSettings in the Web API references at: