Removing leading and trailing blanks while parsing tags