improved HTML recognition