Strips empty tags and whitespace from the end of content