trim whitespace while adding facets, fixes #2952