Improved HTML tag parser algorithm.