remove leading and trailing whitespace from code blocks