Ensure for .Rmd and friends that a code chunk without code is formatted as a code chunk without any lines.
.Rmd
Useful links