ignore whitespaces in content checks

Depending on the way of html generation sometimes whitespaces are contained in the tag contents. But when testing for tag content leading and trailing whitespaces should be ignored.