Trim whitespace from templates.