fixed bug in handling of HTML tags, test added