Remove unwanted whitespace from templates