Added check to see if endIndex token is comment and append EOL if it is