Check if line is end of code chunk in rmd