Remove newlines from the end of templates.