collapse any whitespace into single whitespace