remove trailing whitespace from tags