strip leading and trailing whitespace from template parameter