Add check to ensure trim does not error

- checks that input exists before attempting regex
- silences a thrown error
	- seems to keep with spirit of template filters, if value is not provided no need to throw an error
Merge pull request #18 from benjaminapetersen/feature/trim-fix

Add check to ensure trim does not error